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

Function case

src/tests/from_bits_truncate.rs:26–42  ·  view source on GitHub ↗
(expected: T::Bits, input: T::Bits, inherent: impl FnOnce(T::Bits) -> T)

Source from the content-addressed store, hash-verified

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

Callers 1

casesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected