diff --git a/garde/src/validate.rs b/garde/src/validate.rs index bee9acd..587f0d5 100644 --- a/garde/src/validate.rs +++ b/garde/src/validate.rs @@ -331,3 +331,19 @@ impl Validate for Option { } } } + +impl<'a, B: Validate> Validate for std::borrow::Cow<'a, B> +where + B: ToOwned, +{ + type Context = B::Context; + + fn validate_into( + &self, + ctx: &Self::Context, + parent: &mut dyn FnMut() -> Path, + report: &mut Report, + ) { + self.as_ref().validate_into(ctx, parent, report) + } +}