Closed dpytaylo closed 8 months ago
Could we remove a colon from a tuple struct (newtype pattern) with #[garde(transperent)?
#[garde(transperent)
For an example:
use garde::Validate; #[derive(garde::Validate)] #[garde(transparent)] struct Username( #[garde(length(max = 50))] String, ); fn main() { let a = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; println!("{}", Username(a.into()).validate(&()).unwrap_err().to_string()); }
This code will print this:
: length is greater than 50
I suppose that without a colon, this error message might look better.
Could we remove a colon from a tuple struct (newtype pattern) with
#[garde(transperent)
?For an example:
This code will print this:
I suppose that without a colon, this error message might look better.