mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Remove a Redundant Conditional Check
The existing code check for `where_bounds.is_empty()` twice when it can be combined into one. Moreover, the refactored code reads better and feels straightforward.
This commit is contained in:
parent
006c8df322
commit
1350a65736
@ -959,11 +959,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
|||||||
\n where\n T: {qself_str},\n{}",
|
\n where\n T: {qself_str},\n{}",
|
||||||
where_bounds.join(",\n"),
|
where_bounds.join(",\n"),
|
||||||
));
|
));
|
||||||
}
|
let reported = err.emit();
|
||||||
let reported = err.emit();
|
|
||||||
if !where_bounds.is_empty() {
|
|
||||||
return Err(reported);
|
return Err(reported);
|
||||||
}
|
}
|
||||||
|
err.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(bound)
|
Ok(bound)
|
||||||
|
Loading…
Reference in New Issue
Block a user