Skip to content

Commit 014e610

Browse files
author
Josh Leeb-du Toit
committed
Refactor matches to use Result::err
1 parent 975ff7b commit 014e610

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/librustc_borrowck/borrowck/check_loans.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -395,19 +395,12 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
395395
assert!(self.bccx.region_scope_tree.scopes_intersect(old_loan.kill_scope,
396396
new_loan.kill_scope));
397397

398-
let err_old_new = match self.report_error_if_loan_conflicts_with_restriction(
398+
let err_old_new = Result::err(self.report_error_if_loan_conflicts_with_restriction(
399399
old_loan, new_loan, old_loan, new_loan
400-
) {
401-
Err(err) => Some(err),
402-
Ok(_) => None
403-
};
404-
405-
let err_new_old = match self.report_error_if_loan_conflicts_with_restriction(
400+
));
401+
let err_new_old = Result::err(self.report_error_if_loan_conflicts_with_restriction(
406402
new_loan, old_loan, old_loan, new_loan
407-
) {
408-
Err(err) => Some(err),
409-
Ok(_) => None
410-
};
403+
));
411404

412405
if let Some(mut err_old) = err_old_new {
413406
err_old.emit();

0 commit comments

Comments
 (0)