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

Function case

src/tests/intersects.rs:70–91  ·  view source on GitHub ↗
(
    value: T,
    inputs: &[(T, bool)],
    mut inherent: impl FnMut(&T, T) -> bool,
)

Source from the content-addressed store, hash-verified

68
69#[track_caller]
70fn case<T: Flags + std::fmt::Debug + Copy>(
71 value: T,
72 inputs: &[(T, bool)],
73 mut inherent: impl FnMut(&T, T) -> bool,
74) {
75 for (input, expected) in inputs {
76 assert_eq!(
77 *expected,
78 inherent(&value, *input),
79 "{:?}.intersects({:?})",
80 value,
81 input
82 );
83 assert_eq!(
84 *expected,
85 Flags::intersects(&value, *input),
86 "Flags::intersects({:?}, {:?})",
87 value,
88 input
89 );
90 }
91}

Callers 1

casesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected