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

Function case

src/tests/from_bits_retain.rs:22–38  ·  view source on GitHub ↗
(input: T::Bits, inherent: impl FnOnce(T::Bits) -> T)

Source from the content-addressed store, hash-verified

20
21#[track_caller]
22fn case<T: Flags>(input: T::Bits, inherent: impl FnOnce(T::Bits) -> T)
23where
24 <T as Flags>::Bits: std::fmt::Debug + PartialEq,
25{
26 assert_eq!(
27 input,
28 inherent(input).bits(),
29 "T::from_bits_retain({:?})",
30 input
31 );
32 assert_eq!(
33 input,
34 T::from_bits_retain(input).bits(),
35 "Flags::from_bits_retain({:?})",
36 input
37 );
38}

Callers 1

casesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected