Use Option::map_or instead of .map(..).unwrap_or(..)

This commit is contained in:
LingMan 2021-01-11 20:45:33 +01:00
parent d03fe84169
commit a56bffb4f9
50 changed files with 67 additions and 79 deletions

View file

@ -670,7 +670,7 @@ impl<'tcx> SaveContext<'tcx> {
) -> Option<Ref> {
// Returns true if the path is function type sugar, e.g., `Fn(A) -> B`.
fn fn_type(seg: &hir::PathSegment<'_>) -> bool {
seg.args.map(|args| args.parenthesized).unwrap_or(false)
seg.args.map_or(false, |args| args.parenthesized)
}
let res = self.get_path_res(id);