Rollup merge of #112655 - WaffleLapkin:must_use_map_or, r=workingjubilee
Mark `map_or` as `#[must_use]` I don't know what else to say. r? libs
This commit is contained in:
commit
e3bf088fb5
7 changed files with 13 additions and 10 deletions
|
|
@ -443,9 +443,9 @@ impl<'a, 'tcx> Visitor<'tcx> for DropRangeVisitor<'a, 'tcx> {
|
|||
// We add an edge to the hir_id of the expression/block we are breaking out of, and
|
||||
// then in process_deferred_edges we will map this hir_id to its PostOrderId, which
|
||||
// will refer to the end of the block due to the post order traversal.
|
||||
self.find_target_expression_from_destination(destination).map_or((), |target| {
|
||||
if let Ok(target) = self.find_target_expression_from_destination(destination) {
|
||||
self.drop_ranges.add_control_edge_hir_id(self.expr_index, target)
|
||||
});
|
||||
}
|
||||
|
||||
if let Some(value) = value {
|
||||
self.visit_expr(value);
|
||||
|
|
|
|||
|
|
@ -150,9 +150,10 @@ impl<'tcx> expr_use_visitor::Delegate<'tcx> for ExprUseDelegate<'tcx> {
|
|||
hir.node_to_string(diag_expr_id),
|
||||
hir.node_to_string(parent)
|
||||
);
|
||||
place_with_id
|
||||
.try_into()
|
||||
.map_or((), |tracked_value| self.mark_consumed(parent, tracked_value));
|
||||
|
||||
if let Ok(tracked_value) = place_with_id.try_into() {
|
||||
self.mark_consumed(parent, tracked_value)
|
||||
}
|
||||
}
|
||||
|
||||
fn borrow(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue