Use Option::map_or instead of .map(..).unwrap_or(..)
This commit is contained in:
parent
b5c496de37
commit
961f9ee6df
1 changed files with 2 additions and 2 deletions
|
@ -942,7 +942,7 @@ impl<'a> Clean<Arguments> for (&'a [hir::Ty<'a>], &'a [Ident]) {
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, ty)| {
|
.map(|(i, ty)| {
|
||||||
let mut name = self.1.get(i).map(|ident| ident.name).unwrap_or(kw::Empty);
|
let mut name = self.1.get(i).map_or(kw::Empty, |ident| ident.name);
|
||||||
if name.is_empty() {
|
if name.is_empty() {
|
||||||
name = kw::Underscore;
|
name = kw::Underscore;
|
||||||
}
|
}
|
||||||
|
@ -1001,7 +1001,7 @@ impl<'tcx> Clean<FnDecl> for (DefId, ty::PolyFnSig<'tcx>) {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|t| Argument {
|
.map(|t| Argument {
|
||||||
type_: t.clean(cx),
|
type_: t.clean(cx),
|
||||||
name: names.next().map(|i| i.name).unwrap_or(kw::Empty),
|
name: names.next().map_or(kw::Empty, |i| i.name),
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue