mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 19:56:44 +01:00
constify and deinline some methods
This commit is contained in:
parent
4279503681
commit
18a01b8355
10 changed files with 124 additions and 92 deletions
|
|
@ -63,17 +63,17 @@ try_from_expr!(<'a, E>: Align<RenderBox<'a, E>>: |state, iter|{
|
|||
});
|
||||
|
||||
impl<A> Align<A> {
|
||||
#[inline] pub fn c (a: A) -> Self { Self(Alignment::Center, a) }
|
||||
#[inline] pub fn x (a: A) -> Self { Self(Alignment::X, a) }
|
||||
#[inline] pub fn y (a: A) -> Self { Self(Alignment::Y, a) }
|
||||
#[inline] pub fn n (a: A) -> Self { Self(Alignment::N, a) }
|
||||
#[inline] pub fn s (a: A) -> Self { Self(Alignment::S, a) }
|
||||
#[inline] pub fn e (a: A) -> Self { Self(Alignment::E, a) }
|
||||
#[inline] pub fn w (a: A) -> Self { Self(Alignment::W, a) }
|
||||
#[inline] pub fn nw (a: A) -> Self { Self(Alignment::NW, a) }
|
||||
#[inline] pub fn sw (a: A) -> Self { Self(Alignment::SW, a) }
|
||||
#[inline] pub fn ne (a: A) -> Self { Self(Alignment::NE, a) }
|
||||
#[inline] pub fn se (a: A) -> Self { Self(Alignment::SE, a) }
|
||||
#[inline] pub const fn c (a: A) -> Self { Self(Alignment::Center, a) }
|
||||
#[inline] pub const fn x (a: A) -> Self { Self(Alignment::X, a) }
|
||||
#[inline] pub const fn y (a: A) -> Self { Self(Alignment::Y, a) }
|
||||
#[inline] pub const fn n (a: A) -> Self { Self(Alignment::N, a) }
|
||||
#[inline] pub const fn s (a: A) -> Self { Self(Alignment::S, a) }
|
||||
#[inline] pub const fn e (a: A) -> Self { Self(Alignment::E, a) }
|
||||
#[inline] pub const fn w (a: A) -> Self { Self(Alignment::W, a) }
|
||||
#[inline] pub const fn nw (a: A) -> Self { Self(Alignment::NW, a) }
|
||||
#[inline] pub const fn sw (a: A) -> Self { Self(Alignment::SW, a) }
|
||||
#[inline] pub const fn ne (a: A) -> Self { Self(Alignment::NE, a) }
|
||||
#[inline] pub const fn se (a: A) -> Self { Self(Alignment::SE, a) }
|
||||
}
|
||||
impl<E: Output, A: Content<E>> Content<E> for Align<A> {
|
||||
fn content (&self) -> impl Render<E> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue