jprochazk / garde

A powerful validation library for Rust
Apache License 2.0
455 stars 27 forks source link

feat: implement `Validate` for `Cow` #108

Closed bonofiglio closed 3 months ago

bonofiglio commented 5 months ago

Implements the Validate trait for Cow when the type it's wrapping implements Validate already, similar to all the other smart pointer types.

bonofiglio commented 5 months ago

The nightly test task seems to be failing due to a mismatch in the output of the ui/compile-fail/pattern_mismatched_types.rs test. This fails the same way when my change is not present when I run it locally, so I'm guessing it's a matter of rustc's version. The output is the same, but there are two lines that switched places here:

Expected

   = help: the following other types implement trait `Matcher`:
            once_cell::sync::Lazy<T>
            Regex

Actual

   = help: the following other types implement trait `Matcher`:
            Regex
            once_cell::sync::Lazy<T>

I'm not sure how to proceed.