From 8fd3e61c921894ac53b24c69bee757aaf061ccf9 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Tue, 25 Oct 2022 18:11:26 +0200 Subject: Implement conversion between u32 and Group --- src/geometry/interaction_groups.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/geometry/interaction_groups.rs b/src/geometry/interaction_groups.rs index 2c3b4b3..2dfa098 100644 --- a/src/geometry/interaction_groups.rs +++ b/src/geometry/interaction_groups.rs @@ -150,3 +150,17 @@ bitflags! { const NONE = 0; } } + +impl From for Group { + #[inline] + fn from(val: u32) -> Self { + unsafe { Self::from_bits_unchecked(val) } + } +} + +impl From for u32 { + #[inline] + fn from(val: Group) -> Self { + val.bits() + } +} -- cgit