Skip to content

Commit 7e01809

Browse files
committed
Small cleanup
Remove unnecessary `unwrap`.
1 parent 18f3be7 commit 7e01809

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_resolve/late/diagnostics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -378,15 +378,15 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> {
378378
/// return the span of whole call and the span for all arguments expect the first one (`self`).
379379
fn call_has_self_arg(&self, source: PathSource<'_>) -> Option<(Span, Option<Span>)> {
380380
let mut has_self_arg = None;
381-
if let PathSource::Expr(parent) = source {
382-
match &parent?.kind {
381+
if let PathSource::Expr(Some(parent)) = source {
382+
match &parent.kind {
383383
ExprKind::Call(_, args) if !args.is_empty() => {
384384
let mut expr_kind = &args[0].kind;
385385
loop {
386386
match expr_kind {
387387
ExprKind::Path(_, arg_name) if arg_name.segments.len() == 1 => {
388388
if arg_name.segments[0].ident.name == kw::SelfLower {
389-
let call_span = parent.unwrap().span;
389+
let call_span = parent.span;
390390
let tail_args_span = if args.len() > 1 {
391391
Some(Span::new(
392392
args[1].span.lo(),

0 commit comments

Comments
 (0)