MCPcopy Create free account
hub / github.com/bitflags/bitflags / case

Function case

src/tests/complement.rs:38–53  ·  view source on GitHub ↗
(
    expected: T::Bits,
    value: T,
    inherent: impl FnOnce(T) -> T,
)

Source from the content-addressed store, hash-verified

36
37#[track_caller]
38fn case<T: Flags + std::fmt::Debug + std::ops::Not<Output = T> + Copy>(
39 expected: T::Bits,
40 value: T,
41 inherent: impl FnOnce(T) -> T,
42) where
43 T::Bits: std::fmt::Debug + PartialEq,
44{
45 assert_eq!(expected, inherent(value).bits(), "{:?}.complement()", value);
46 assert_eq!(
47 expected,
48 Flags::complement(value).bits(),
49 "Flags::complement({:?})",
50 value
51 );
52 assert_eq!(expected, (!value).bits(), "!{:?}", value);
53}

Callers 1

casesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected