From ae0ccf43f11be5c00bb9cd49996c8bb06a7e1651 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Wed, 9 Mar 2022 14:09:22 -0800 Subject: [PATCH] Fix parsing docs for 'Lenient'. Resolves #2039. --- core/lib/src/form/lenient.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/lib/src/form/lenient.rs b/core/lib/src/form/lenient.rs index e5397629..0f6f6b6c 100644 --- a/core/lib/src/form/lenient.rs +++ b/core/lib/src/form/lenient.rs @@ -8,9 +8,7 @@ use crate::http::uri::fmt::{Query, FromUriParam}; /// This type implements the [`FromForm`] trait and thus can be used as a /// generic parameter to the [`Form`] data guard: `Form>`, where `T` /// implements `FromForm`. Unlike using `Form` directly, this type uses a -/// _lenient_ parsing strategy: forms that contains a superset of the expected -/// fields (i.e, extra fields) will fail to parse and defaults will not be use -/// for missing fields. +/// _lenient_ parsing strategy. /// /// # Lenient Parsing /// @@ -35,6 +33,8 @@ use crate::http::uri::fmt::{Query, FromUriParam}; /// /// #[derive(FromForm)] /// struct UserInput { +/// // Parses as `Some(false)` when `lenient_inner_option` isn't present. +/// // Without `Lenient`, this would otherwise parse as `None`. /// lenient_inner_option: Option>, /// } /// ```