Annotate at_least and at_most with #[must_use]

This commit is contained in:
Emil Ernerfeldt 2022-12-15 15:38:31 +01:00
parent ea5c9483a2
commit 367087f84f

View file

@ -242,9 +242,11 @@ fn test_remap() {
/// Extends `f32`, [`Vec2`] etc with `at_least` and `at_most` as aliases for `max` and `min`. /// Extends `f32`, [`Vec2`] etc with `at_least` and `at_most` as aliases for `max` and `min`.
pub trait NumExt { pub trait NumExt {
/// More readable version of `self.max(lower_limit)` /// More readable version of `self.max(lower_limit)`
#[must_use]
fn at_least(self, lower_limit: Self) -> Self; fn at_least(self, lower_limit: Self) -> Self;
/// More readable version of `self.min(upper_limit)` /// More readable version of `self.min(upper_limit)`
#[must_use]
fn at_most(self, upper_limit: Self) -> Self; fn at_most(self, upper_limit: Self) -> Self;
} }