Resolve option_map_unwrap_or_else lint

This commit is contained in:
David Tolnay 2019-04-10 22:57:47 -07:00
parent e9cd73f78e
commit 79a20e9e33
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -689,8 +689,7 @@ impl Container {
pub fn serde_path(&self) -> Cow<syn::Path> { pub fn serde_path(&self) -> Cow<syn::Path> {
self.custom_serde_path() self.custom_serde_path()
.map(Cow::Borrowed) .map_or_else(|| Cow::Owned(parse_quote!(_serde)), Cow::Borrowed)
.unwrap_or_else(|| Cow::Owned(parse_quote!(_serde)))
} }
} }