Silence clippy warning

This commit is contained in:
Jonas Platte 2020-02-13 12:11:43 +01:00
parent 2f95a299b7
commit d31583a826
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -56,6 +56,8 @@ where
T: serde::Deserialize<'de>,
{
let opt = Option::<String>::deserialize(de)?;
// TODO: Switch to and remove this attribute `opt.as_deref()` once MSRV is >= 1.40
#[allow(clippy::clippy::option_as_ref_deref)]
let opt = opt.as_ref().map(String::as_str);
match opt {
None | Some("") => Ok(None),