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

Function cases

src/tests/from_bits.rs:6–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5#[test]
6fn cases() {
7 case(Some(0), 0, TestFlags::from_bits);
8 case(Some(1), 1, TestFlags::from_bits);
9 case(
10 Some(1 | 1 << 1 | 1 << 2),
11 1 | 1 << 1 | 1 << 2,
12 TestFlags::from_bits,
13 );
14
15 case(None, 1 << 3, TestFlags::from_bits);
16 case(None, 1 | 1 << 3, TestFlags::from_bits);
17
18 case(Some(1 | 1 << 1), 1 | 1 << 1, TestOverlapping::from_bits);
19
20 case(Some(1 << 1), 1 << 1, TestOverlapping::from_bits);
21
22 case(Some(1 << 5), 1 << 5, TestExternal::from_bits);
23}
24
25#[track_caller]
26fn case<T: Flags>(

Callers

nothing calls this directly

Calls 1

caseFunction · 0.70

Tested by

no test coverage detected