We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c56896 commit 7402366Copy full SHA for 7402366
crates/ide-assists/src/handlers/extract_function.rs
@@ -1288,13 +1288,19 @@ fn last_impl_member(impl_node: &SyntaxNode) -> Option<SyntaxNode> {
1288
}
1289
1290
fn is_trait_impl(node: &SyntaxNode) -> bool {
1291
+ if !ast::Impl::can_cast(node.kind()) {
1292
+ return false;
1293
+ }
1294
match ast::Impl::cast(node.clone()) {
1295
Some(c) => c.trait_().is_some(),
1296
None => false,
1297
1298
1299
1300
fn impl_type_name(impl_node: &SyntaxNode) -> Option<String> {
1301
+ if !ast::Impl::can_cast(impl_node.kind()) {
1302
+ return None;
1303
1304
Some(ast::Impl::cast(impl_node.clone())?.self_ty()?.to_string())
1305
1306
0 commit comments