Use Option::map_or instead of .map(..).unwrap_or(..)
This commit is contained in:
parent
d03fe84169
commit
a56bffb4f9
50 changed files with 67 additions and 79 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue