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

Function case

src/tests/known_bits.rs:33–47  ·  view source on GitHub ↗
(
    expected: T::Bits,
    value: T,
    inherent: impl FnOnce(&T) -> T::Bits,
)

Source from the content-addressed store, hash-verified

31
32#[track_caller]
33fn case<T: Flags + std::fmt::Debug>(
34 expected: T::Bits,
35 value: T,
36 inherent: impl FnOnce(&T) -> T::Bits,
37) where
38 T::Bits: std::fmt::Debug + PartialEq,
39{
40 assert_eq!(expected, inherent(&value), "{:?}.known_bits()", value);
41 assert_eq!(
42 expected,
43 Flags::known_bits(&value),
44 "Flags::known_bits({:?})",
45 value,
46 );
47}

Callers 1

casesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected