Update crates/ide-assists/src/handlers/generate_trait_from_impl.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
parent
677151e4e1
commit
20c877a700
1 changed files with 1 additions and 7 deletions
|
|
@ -73,13 +73,7 @@ pub(crate) fn generate_trait_from_impl(acc: &mut Assists, ctx: &AssistContext<'_
|
|||
return None;
|
||||
}
|
||||
|
||||
let assoc_items = impl_ast.assoc_item_list();
|
||||
if assoc_items.is_none() {
|
||||
// Also do not do anything if no assoc item is there.
|
||||
return None;
|
||||
}
|
||||
|
||||
let assoc_items = assoc_items.unwrap();
|
||||
let assoc_items = impl_ast.assoc_item_list()?;
|
||||
let first_element = assoc_items.assoc_items().next();
|
||||
if first_element.is_none() {
|
||||
// No reason for an assist.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue