cleanup: don't manually unwrap_or_default()
This commit is contained in:
parent
9903b256a2
commit
1a28599981
@ -627,8 +627,7 @@ fn concat_trees(
|
||||
base: Option<Self::TokenStream>,
|
||||
trees: Vec<TokenTree<Self::TokenStream, Self::Span, Self::Symbol>>,
|
||||
) -> Self::TokenStream {
|
||||
let mut stream =
|
||||
if let Some(base) = base { base } else { tokenstream::TokenStream::default() };
|
||||
let mut stream = base.unwrap_or_default();
|
||||
for tree in trees {
|
||||
for tt in (tree, &mut *self).to_internal() {
|
||||
stream.push_tree(tt);
|
||||
@ -642,8 +641,7 @@ fn concat_streams(
|
||||
base: Option<Self::TokenStream>,
|
||||
streams: Vec<Self::TokenStream>,
|
||||
) -> Self::TokenStream {
|
||||
let mut stream =
|
||||
if let Some(base) = base { base } else { tokenstream::TokenStream::default() };
|
||||
let mut stream = base.unwrap_or_default();
|
||||
for s in streams {
|
||||
stream.push_stream(s);
|
||||
}
|
||||
|
@ -1369,13 +1369,9 @@ fn compute_2229_migrations(
|
||||
for (&var_hir_id, _) in upvars.iter() {
|
||||
let mut diagnostics_info = Vec::new();
|
||||
|
||||
let auto_trait_diagnostic = if let Some(diagnostics_info) =
|
||||
self.compute_2229_migrations_for_trait(min_captures, var_hir_id, closure_clause)
|
||||
{
|
||||
diagnostics_info
|
||||
} else {
|
||||
FxIndexMap::default()
|
||||
};
|
||||
let auto_trait_diagnostic = self
|
||||
.compute_2229_migrations_for_trait(min_captures, var_hir_id, closure_clause)
|
||||
.unwrap_or_default();
|
||||
|
||||
let drop_reorder_diagnostic = if let Some(diagnostics_info) = self
|
||||
.compute_2229_migrations_for_drop(
|
||||
|
Loading…
Reference in New Issue
Block a user