Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display is not implemented for Option<T> #55

Closed
omid opened this issue Jul 28, 2023 · 2 comments
Closed

Display is not implemented for Option<T> #55

omid opened this issue Jul 28, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@omid
Copy link

omid commented Jul 28, 2023

I tried to integrate garde in our project. But I got this error:

    = help: the trait `std::fmt::Display` is not implemented for `std::option::Option<i32>`
    = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
 note: required by a bound in `garde::rules::range::apply`
   --> /home/developer/registry/src/index.crates.io-6f17d22bba15001f/garde-0.12.0/src/rules/range.rs:19:26
    |
 19 | pub fn apply<T: Bounds + Display>(v: &T, (min, max): (&T::Size, &T::Size)) -> Result<(), Error> {
    |                          ^^^^^^^ required by this bound in `apply`
    = note: this error originates in the derive macro `Validate` (in Nightly builds, run with -Z macro-backtrace for more info)

The garde is #[garde(range(min = 1))] on a field with Option<i32> type.

@jprochazk jprochazk added the bug Something isn't working label Jul 28, 2023
@jprochazk
Copy link
Owner

Fixed and released in v0.13

@omid
Copy link
Author

omid commented Jul 28, 2023

Wow, thanks
That was the fastest fix and release in the history ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants