@@ -825,14 +825,14 @@ impl<'a> CheckLoanCtxt<'a> {
825
825
this : & CheckLoanCtxt ,
826
826
assignment_id : ast:: NodeId ,
827
827
assignment_span : Span ,
828
- assignee_cmt : mc:: cmt ) -> bool
828
+ assignee_cmt : mc:: cmt )
829
829
{
830
830
//! Check for assignments that violate the terms of an
831
831
//! outstanding loan.
832
832
833
833
let loan_path = match opt_loan_path ( & assignee_cmt) {
834
834
Some ( lp) => lp,
835
- None => { return true ; /* no loan path, can't be any loans */ }
835
+ None => { return ; /* no loan path, can't be any loans */ }
836
836
} ;
837
837
838
838
// Start by searching for an assignment to a *restricted*
@@ -852,7 +852,7 @@ impl<'a> CheckLoanCtxt<'a> {
852
852
false
853
853
} ) ;
854
854
855
- if !cont { return false }
855
+ if !cont { return ; }
856
856
857
857
// The previous code handled assignments to paths that
858
858
// have been restricted. This covers paths that have been
@@ -899,21 +899,19 @@ impl<'a> CheckLoanCtxt<'a> {
899
899
LpExtend ( _, mc:: McDeclared , _) |
900
900
LpExtend ( _, mc:: McImmutable , _) |
901
901
LpVar ( _) => {
902
- return true ;
902
+ return ;
903
903
}
904
904
} ;
905
905
906
906
// Check for a non-const loan of `loan_path`
907
- let cont = this. each_in_scope_loan ( assignment_id, |loan| {
907
+ this. each_in_scope_loan ( assignment_id, |loan| {
908
908
if loan. loan_path == loan_path {
909
909
this. report_illegal_mutation ( assignment_span, & * full_loan_path, loan) ;
910
910
false
911
911
} else {
912
912
true
913
913
}
914
914
} ) ;
915
-
916
- if !cont { return false }
917
915
}
918
916
}
919
917
}
0 commit comments