From f53d2b257cfef3e02192f2735924aaf1223818a0 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 16 Oct 2018 15:25:18 +0200 Subject: [PATCH] mir/borrowck: remove redundant returns --- src/librustc_mir/borrow_check/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index ce0cc20f6de..aeb77c67317 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -1589,7 +1589,7 @@ fn move_path_closest_to<'a>( Place::Local(_) => panic!("should have move path for every Local"), Place::Projection(_) => panic!("PrefixSet::All meant don't stop for Projection"), Place::Promoted(_) | - Place::Static(_) => return Err(NoMovePathFound::ReachedStatic), + Place::Static(_) => Err(NoMovePathFound::ReachedStatic), } } @@ -1881,7 +1881,7 @@ fn check_access_permissions( } // at this point, we have set up the error reporting state. - if previously_initialized { + return if previously_initialized { self.report_mutability_error( place, span, @@ -1889,10 +1889,10 @@ fn check_access_permissions( error_access, location, ); - return true; + true } else { - return false; - } + false + }; } fn is_local_ever_initialized(&self, @@ -1907,7 +1907,7 @@ fn is_local_ever_initialized(&self, return Some(index); } } - return None; + None } /// Adds the place into the used mutable variables set -- 2.44.0