-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
Code of Conduct
- I agree to follow this project's Code of Conduct
Current Behaviour
sets variant values starting at 0
Expected Behaviour
set variants starting at 1
Environment Information
rust: rustc 1.89.0
linux: Linux pc 6.16.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 15 Aug 2025 16:04:43 +0000 x86_64 GNU/Linux
flagset: 0.4.7
with no features
Steps To Reproduce
This code fails when expecting the variant A
to be 1
.
use flagset::flags;
fn main() {
let f = Flag::A;
assert_eq!(f as u64, 1); // This fails.
}
flags! {
enum Flag: u64 {
A, // should be 0b001 but is 0b000
B // should be 0b002 but is 0b001
}
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
New