bounded-integer
bounded-integer copied to clipboard
Support for integers bound to a single value
bounded_integer! {
pub struct Test { 0..1 }
}
This raises the following error.
error: The start of the range must be before the end
--> src/main.rs:10:23
|
10 | pub struct Test { 0..1 }
| ^^^^
Perhaps it is not a common use case but creating a bounded integer that is bound to a single value should be plausible? Based on the error message I suspect this is an off by one error in the range validation logic. New to rust, especially macros, but I'll take a look and see if I can make a PR.
https://github.com/Kestrer/bounded-integer/pull/24
I believe this should be supported in 0.6.0 anyway.