Closed LeonidKrutovsky closed 4 years ago
In generated file xsd/types.rs
// Type used to represent the numbers from 1 ,2 , 3,... #[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct PositiveInteger (pub u32); impl Validate for PositiveInteger { fn validate(&self) -> Result<(), String> { if self.0 < "1".parse().unwrap() { return Err(format!("MinInclusive validation error: invalid value of 0! \nExpected: 0 >= 1.\nActual: 0 == {}", self.0)); } Ok(()) } }
Compiler result:
error[E0283]: type annotations needed --> src/schema/types.rs:106:19 | 106 | if self.0 < "1".parse().unwrap() { | ^ cannot infer type for type `u32` | = note: cannot resolve `u32: std::cmp::PartialOrd<_>`
In generated file xsd/types.rs
Compiler result: