mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Inline a single-use closure
This commit is contained in:
parent
f499601dd8
commit
66c2872901
@ -1771,7 +1771,6 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||||||
path
|
path
|
||||||
);
|
);
|
||||||
let ns = source.namespace();
|
let ns = source.namespace();
|
||||||
let is_expected = &|res| source.is_expected(res);
|
|
||||||
|
|
||||||
let report_errors = |this: &mut Self, res: Option<Res>| {
|
let report_errors = |this: &mut Self, res: Option<Res>| {
|
||||||
if this.should_report_errs() {
|
if this.should_report_errs() {
|
||||||
@ -1874,7 +1873,8 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||||||
crate_lint,
|
crate_lint,
|
||||||
) {
|
) {
|
||||||
Ok(Some(partial_res)) if partial_res.unresolved_segments() == 0 => {
|
Ok(Some(partial_res)) if partial_res.unresolved_segments() == 0 => {
|
||||||
if is_expected(partial_res.base_res()) || partial_res.base_res() == Res::Err {
|
if source.is_expected(partial_res.base_res()) || partial_res.base_res() == Res::Err
|
||||||
|
{
|
||||||
partial_res
|
partial_res
|
||||||
} else {
|
} else {
|
||||||
report_errors(self, Some(partial_res.base_res()))
|
report_errors(self, Some(partial_res.base_res()))
|
||||||
|
Loading…
Reference in New Issue
Block a user