From 7e0180906b0fe738596bff512c96c3f36afaf6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Sun, 9 Aug 2020 17:48:32 -0700 Subject: [PATCH] Small cleanup Remove unnecessary `unwrap`. --- src/librustc_resolve/late/diagnostics.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc_resolve/late/diagnostics.rs b/src/librustc_resolve/late/diagnostics.rs index ec6dbb070df..fdc524a8e39 100644 --- a/src/librustc_resolve/late/diagnostics.rs +++ b/src/librustc_resolve/late/diagnostics.rs @@ -378,15 +378,15 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> { /// return the span of whole call and the span for all arguments expect the first one (`self`). fn call_has_self_arg(&self, source: PathSource<'_>) -> Option<(Span, Option)> { let mut has_self_arg = None; - if let PathSource::Expr(parent) = source { - match &parent?.kind { + if let PathSource::Expr(Some(parent)) = source { + match &parent.kind { ExprKind::Call(_, args) if !args.is_empty() => { let mut expr_kind = &args[0].kind; loop { match expr_kind { ExprKind::Path(_, arg_name) if arg_name.segments.len() == 1 => { if arg_name.segments[0].ident.name == kw::SelfLower { - let call_span = parent.unwrap().span; + let call_span = parent.span; let tail_args_span = if args.len() > 1 { Some(Span::new( args[1].span.lo(),