Skip to content

Commit f53d2b2

Browse files
committed
mir/borrowck: remove redundant returns
1 parent cd03f5d commit f53d2b2

File tree

1 file changed

+6
-6
lines changed
  • src/librustc_mir/borrow_check

1 file changed

+6
-6
lines changed

src/librustc_mir/borrow_check/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
15891589
Place::Local(_) => panic!("should have move path for every Local"),
15901590
Place::Projection(_) => panic!("PrefixSet::All meant don't stop for Projection"),
15911591
Place::Promoted(_) |
1592-
Place::Static(_) => return Err(NoMovePathFound::ReachedStatic),
1592+
Place::Static(_) => Err(NoMovePathFound::ReachedStatic),
15931593
}
15941594
}
15951595

@@ -1881,18 +1881,18 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
18811881
}
18821882

18831883
// at this point, we have set up the error reporting state.
1884-
if previously_initialized {
1884+
return if previously_initialized {
18851885
self.report_mutability_error(
18861886
place,
18871887
span,
18881888
the_place_err,
18891889
error_access,
18901890
location,
18911891
);
1892-
return true;
1892+
true
18931893
} else {
1894-
return false;
1895-
}
1894+
false
1895+
};
18961896
}
18971897

18981898
fn is_local_ever_initialized(&self,
@@ -1907,7 +1907,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
19071907
return Some(index);
19081908
}
19091909
}
1910-
return None;
1910+
None
19111911
}
19121912

19131913
/// Adds the place into the used mutable variables set

0 commit comments

Comments
 (0)