Skip to content

Commit bec0c1c

Browse files
committed
Use bitshifting when defining uname bitflags
1 parent 456fac3 commit bec0c1c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/bin/uname.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ use sap::{
88
};
99

1010
bitflags::bitflags! {
11-
#[derive(Debug)]
11+
#[rustfmt::skip]
1212
pub struct Info: u8 {
13-
const KERNEL_NAME = 0b00000001;
14-
const NODENAME = 0b00000010;
15-
const KERNEL_RELEASE = 0b00000100;
16-
const KERNEL_VERSION = 0b00001000;
17-
const MACHINE = 0b00010000;
18-
const PROCESSOR = 0b00100000;
19-
const HARDWARE_PLATFORM = 0b01000000;
20-
const OPERATING_SYSTEM = 0b10000000;
13+
const KERNEL_NAME = 1 << 0;
14+
const NODENAME = 1 << 1;
15+
const KERNEL_RELEASE = 1 << 2;
16+
const KERNEL_VERSION = 1 << 3;
17+
const MACHINE = 1 << 4;
18+
const PROCESSOR = 1 << 5;
19+
const HARDWARE_PLATFORM = 1 << 6;
20+
const OPERATING_SYSTEM = 1 << 7;
2121
}
2222
}
2323

0 commit comments

Comments
 (0)