Skip to content

Commit

Permalink
Auto merge of rust-lang#15433 - alibektas:deunwrap/remove_unused_impo…
Browse files Browse the repository at this point in the history
…rts, r=lnicola

minor : Deunwrap remove_unused_imports

rust-lang#15398 Subtask 3
  • Loading branch information
bors committed Aug 11, 2023
2 parents de28baf + 423b00a commit 1fde334
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/ide-assists/src/handlers/remove_unused_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub(crate) fn remove_unused_imports(acc: &mut Assists, ctx: &AssistContext<'_>)
// This case maps to the situation where the * token is braced.
// In this case, the parent use tree's path is the one we should use to resolve the glob.
match u.syntax().ancestors().skip(1).find_map(ast::UseTree::cast) {
Some(parent_u) if parent_u.path().is_some() => parent_u.path().unwrap(),
Some(parent_u) if parent_u.path().is_some() => parent_u.path()?,
_ => return None,
}
} else {
Expand Down

0 comments on commit 1fde334

Please sign in to comment.