Skip to content

Commit

Permalink
Rollup merge of #75353 - estebank:tiny, r=jyn514
Browse files Browse the repository at this point in the history
Tiny cleanup, remove unnecessary `unwrap`

Remove unnecessary `unwrap`.
  • Loading branch information
JohnTitor authored Aug 11, 2020
2 parents e51a839 + 7e01809 commit 0a8d4db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_resolve/late/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,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<Span>)> {
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(),
Expand Down

0 comments on commit 0a8d4db

Please sign in to comment.