mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-08 12:46: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
|
|
@ -26,9 +26,9 @@ macro_rules! transform_xy {
|
|||
($x:literal $y:literal $xy:literal |$self:ident : $Enum:ident, $to:ident|$area:expr) => {
|
||||
pub enum $Enum<T> { X(T), Y(T), XY(T) }
|
||||
impl<T> $Enum<T> {
|
||||
#[inline] pub fn x (item: T) -> Self { Self::X(item) }
|
||||
#[inline] pub fn y (item: T) -> Self { Self::Y(item) }
|
||||
#[inline] pub fn xy (item: T) -> Self { Self::XY(item) }
|
||||
#[inline] pub const fn x (item: T) -> Self { Self::X(item) }
|
||||
#[inline] pub const fn y (item: T) -> Self { Self::Y(item) }
|
||||
#[inline] pub const fn xy (item: T) -> Self { Self::XY(item) }
|
||||
}
|
||||
#[cfg(feature = "dsl")]
|
||||
impl<'a, E: Output + 'a, T: ViewContext<'a, E>> TryFromAtom<'a, T>
|
||||
|
|
@ -78,9 +78,9 @@ macro_rules! transform_xy_unit {
|
|||
($x:literal $y:literal $xy:literal |$self:ident : $Enum:ident, $to:ident|$layout:expr) => {
|
||||
pub enum $Enum<U, T> { X(U, T), Y(U, T), XY(U, U, T), }
|
||||
impl<U, T> $Enum<U, T> {
|
||||
#[inline] pub fn x (x: U, item: T) -> Self { Self::X(x, item) }
|
||||
#[inline] pub fn y (y: U, item: T) -> Self { Self::Y(y, item) }
|
||||
#[inline] pub fn xy (x: U, y: U, item: T) -> Self { Self::XY(x, y, item) }
|
||||
#[inline] pub const fn x (x: U, item: T) -> Self { Self::X(x, item) }
|
||||
#[inline] pub const fn y (y: U, item: T) -> Self { Self::Y(y, item) }
|
||||
#[inline] pub const fn xy (x: U, y: U, item: T) -> Self { Self::XY(x, y, item) }
|
||||
}
|
||||
#[cfg(feature = "dsl")]
|
||||
impl<'a, E: Output + 'a, T: ViewContext<'a, E>> TryFromAtom<'a, T>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue