Fix parsing docs for 'Lenient'.

Resolves #2039.
This commit is contained in:
Sergio Benitez 2022-03-09 14:09:22 -08:00
parent 4fcb57b704
commit ae0ccf43f1
1 changed files with 3 additions and 3 deletions

View File

@ -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<Lenient<T>>`, 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<Lenient<bool>>,
/// }
/// ```