From 27412a1f81e9cac91e658e1a48d0cec74082dbf9 Mon Sep 17 00:00:00 2001 From: gengteng Date: Wed, 27 Sep 2023 19:09:54 +0800 Subject: [PATCH] impl FromRef<()> for ValidationContext<()> --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 795d13c..9b9df56 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -293,6 +293,12 @@ impl ValidationContext { } } +impl FromRef<()> for ValidationContext<()> { + fn from_ref(_: &()) -> Self { + ValidationContext::default() + } +} + /// `ValidError` is the error type returned when the `Valid` extractor fails. /// /// It has two variants: