Skip to content

Commit 08be313

Browse files
committed
Use Option::then in two places
1 parent d5f9c40 commit 08be313

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_mir_build/src/build/matches/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
264264
// The set of places that we are creating fake borrows of. If there are
265265
// no match guards then we don't need any fake borrows, so don't track
266266
// them.
267-
let mut fake_borrows = if match_has_guard { Some(FxHashSet::default()) } else { None };
267+
let mut fake_borrows = match_has_guard.then(FxHashSet::default);
268268

269269
let mut otherwise = None;
270270

compiler/rustc_query_system/src/dep_graph/serialized.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl<K: DepKind> EncoderState<K> {
182182
total_edge_count: 0,
183183
total_node_count: 0,
184184
result: Ok(()),
185-
stats: if record_stats { Some(FxHashMap::default()) } else { None },
185+
stats: record_stats.then(FxHashMap::default),
186186
}
187187
}
188188

0 commit comments

Comments
 (0)