Use Option::map_or instead of .map(..).unwrap_or(..)
This commit is contained in:
@@ -561,7 +561,7 @@ impl WhereClause<'_> {
|
||||
/// in `fn foo<T>(t: T) where T: Foo,` so we don't suggest two trailing commas.
|
||||
pub fn tail_span_for_suggestion(&self) -> Span {
|
||||
let end = self.span_for_predicates_or_empty_place().shrink_to_hi();
|
||||
self.predicates.last().map(|p| p.span()).unwrap_or(end).shrink_to_hi().to(end)
|
||||
self.predicates.last().map_or(end, |p| p.span()).shrink_to_hi().to(end)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user