diff options
author | HampusM <hampus@hampusmat.com> | 2025-03-18 13:21:46 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-03-18 13:21:46 +0100 |
commit | 7a7d3a350b22b5555c27debff6fee4fc6100fa38 (patch) | |
tree | 9eb96f2563264f51691e2a06a7b95f8b39904d18 /ecs/src/util.rs | |
parent | ee7c0cb713891ae480407f56823289f3fe3b9807 (diff) |
Diffstat (limited to 'ecs/src/util.rs')
-rw-r--r-- | ecs/src/util.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ecs/src/util.rs b/ecs/src/util.rs index fbd33fa..17436ff 100644 --- a/ecs/src/util.rs +++ b/ecs/src/util.rs @@ -55,9 +55,11 @@ pub trait StreamingIterator Self: Sized, Predicate: FnMut(&Self::Item<'this>) -> bool, { - while let Some(item) = - unsafe { transmute::<_, Option<Self::Item<'_>>>(self.streaming_next()) } - { + while let Some(item) = unsafe { + transmute::<Option<Self::Item<'_>>, Option<Self::Item<'_>>>( + self.streaming_next(), + ) + } { if predicate(&item) { return Some(item); } @@ -97,7 +99,7 @@ pub enum BorrowedOrOwned<'a, Value> Owned(Value), } -impl<'a, Value> Deref for BorrowedOrOwned<'a, Value> +impl<Value> Deref for BorrowedOrOwned<'_, Value> { type Target = Value; @@ -240,6 +242,7 @@ impl BitMask<u64> Self { mask } } + #[must_use] pub const fn value(self) -> u64 { self.mask @@ -266,6 +269,7 @@ impl BitAnd<u64> for BitMask<u64> pub trait NumberExt: Sized { /// Returns a range of bits (field) specified by the provided [`BitMask`]. + #[must_use] fn field_get(self, field_mask: BitMask<Self>) -> Self; } |