diff --git a/crates/bevy_math/src/aspect_ratio.rs b/crates/bevy_math/src/aspect_ratio.rs index a318ff0296b1c..1a07de91d3438 100644 --- a/crates/bevy_math/src/aspect_ratio.rs +++ b/crates/bevy_math/src/aspect_ratio.rs @@ -45,31 +45,31 @@ impl AspectRatio { /// Returns the aspect ratio as a f32 value. #[inline] - pub fn ratio(&self) -> f32 { + pub const fn ratio(&self) -> f32 { self.0 } /// Returns the inverse of this aspect ratio (height/width). #[inline] - pub fn inverse(&self) -> Self { + pub const fn inverse(&self) -> Self { Self(1.0 / self.0) } /// Returns true if the aspect ratio represents a landscape orientation. #[inline] - pub fn is_landscape(&self) -> bool { + pub const fn is_landscape(&self) -> bool { self.0 > 1.0 } /// Returns true if the aspect ratio represents a portrait orientation. #[inline] - pub fn is_portrait(&self) -> bool { + pub const fn is_portrait(&self) -> bool { self.0 < 1.0 } /// Returns true if the aspect ratio is exactly square. #[inline] - pub fn is_square(&self) -> bool { + pub const fn is_square(&self) -> bool { self.0 == 1.0 } } diff --git a/crates/bevy_math/src/rotation2d.rs b/crates/bevy_math/src/rotation2d.rs index 4ad267d83da87..2b73d0ce330c3 100644 --- a/crates/bevy_math/src/rotation2d.rs +++ b/crates/bevy_math/src/rotation2d.rs @@ -350,7 +350,7 @@ impl Rot2 { #[inline] #[must_use] #[doc(alias = "conjugate")] - pub fn inverse(self) -> Self { + pub const fn inverse(self) -> Self { Self { cos: self.cos, sin: -self.sin,