Keats / validator

Simple validation for Rust structs
MIT License
2.03k stars 147 forks source link

Large integers may lose some lowest bits in `range` #228

Open zhu-he opened 2 years ago

zhu-he commented 2 years ago
#[test]
fn test() {
    #[derive(Debug, Validate)]
    struct TestStruct {
        #[validate(range(max = 10000000000000000))]
        val: u64,
    }
    let s = TestStruct { val: 10000000000000001 };
    assert!(s.validate().is_err());
}