You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could we remove a colon from a tuple struct (newtype pattern) with #[garde(transperent)?
For an example:
use garde::Validate;#[derive(garde::Validate)]#[garde(transparent)]structUsername(#[garde(length(max = 50))]String,);fnmain(){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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: