]> git.lizzy.rs Git - enumset.git/commitdiff
Fix from_bits_safe.
authorLymia Aluysia <lymia@lymiahugs.com>
Mon, 30 Mar 2020 13:58:21 +0000 (06:58 -0700)
committerLymia Aluysia <lymia@lymiahugs.com>
Mon, 30 Mar 2020 13:58:21 +0000 (06:58 -0700)
enumset/src/lib.rs

index 7ce0bd8719d38a3d31d3e904e6159f38085bdcdc..97967e6d15c464bca30fed3f4ef9819827a1325e 100644 (file)
@@ -297,7 +297,7 @@ impl <T : EnumSetType> EnumSet<T> {
 
     /// Constructs a bitset from raw bits, ignoring any unknown variants.
     pub fn from_bits_safe(bits: u128) -> Self {
-        Self::form_bits(bits & Self::all().to_bits())
+        Self::from_bits(bits & Self::all().to_bits())
     }
 
     /// Returns the number of elements in this set.
@@ -513,7 +513,7 @@ impl <'de, T : EnumSetType> Deserialize<'de> for EnumSet<T> {
 }
 
 /// The iterator used by [`EnumSet`]s.
-#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Hash, Debug)]
+#[derive(Clone, Debug)]
 pub struct EnumSetIter<T : EnumSetType>(EnumSet<T>, u8);
 impl <T : EnumSetType> Iterator for EnumSetIter<T> {
     type Item = T;