Deunwrap remove_unused_imports
This commit is contained in:
parent
b78d69c795
commit
423b00a83a
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user