-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What version are you using?
0.0.5
What did you do?
Used bytes!(0) or bytes!(0o0) to convert the zero literal to bytes.
let b = bytes_lit::bytes!(0);
let b = bytes_lit::bytes!(0o0);What did you expect to see?
Both produce [0u8], consistent with the hex and binary forms which already work:
bytes_lit::bytes!(0x0); // => [0u8] ✓
bytes_lit::bytes!(0b0); // => [0u8] ✓What did you see instead?
Compile error:
leading zeros are not preserved or supported on integer literals in decimal form
leading zeros are not preserved or supported on integer literals in octal form
The leading-zero detection in bytes() treats the sole 0 digit as a leading zero. When the entire value is zero there is no meaningful leading zero to reject — it is just the value itself.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working