Skip to content

Commit

Permalink
Rollup merge of rust-lang#93589 - est31:option_then, r=cjgillot
Browse files Browse the repository at this point in the history
Use Option::then in two places
  • Loading branch information
matthiaskrgr authored Feb 3, 2022
2 parents 19e74d6 + 08be313 commit 7dbb270
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/build/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
// The set of places that we are creating fake borrows of. If there are
// no match guards then we don't need any fake borrows, so don't track
// them.
let mut fake_borrows = if match_has_guard { Some(FxHashSet::default()) } else { None };
let mut fake_borrows = match_has_guard.then(FxHashSet::default);

let mut otherwise = None;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_query_system/src/dep_graph/serialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl<K: DepKind> EncoderState<K> {
total_edge_count: 0,
total_node_count: 0,
result: Ok(()),
stats: if record_stats { Some(FxHashMap::default()) } else { None },
stats: record_stats.then(FxHashMap::default),
}
}

Expand Down

0 comments on commit 7dbb270

Please sign in to comment.