1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// Determine wether the `bitfield.set()` method changed the underlying value.
#[derive(Debug, PartialEq)]
pub enum Change {
  /// The value was changed. Equal to `true` in `mafintosh/sparse-bitfield`.
  Changed,
  /// The value was not changed. Equal to `false` in
  /// `mafintosh/sparse-bitfield`.
  Unchanged,
}

impl Change {
  /// Returns `true` if the result is `Changed`.
  #[inline]
  pub fn is_changed(&self) -> bool {
    *self == Change::Changed
  }

  /// Returns `true` if the result is `Unchanged`.
  #[inline]
  pub fn is_unchanged(&self) -> bool {
    !self.is_changed()
  }
}