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

Function case

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

Source from the content-addressed store, hash-verified

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

Callers 1

casesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected