We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb5ae99 commit 54e9324Copy full SHA for 54e9324
crates/ide-assists/src/handlers/move_format_string_arg.rs
@@ -41,7 +41,7 @@ use syntax::{ast, AstNode, AstToken, NodeOrToken, SyntaxKind::COMMA, TextRange};
41
42
pub(crate) fn move_format_string_arg(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> {
43
let fmt_string = ctx.find_token_at_offset::<ast::String>()?;
44
- let tt = fmt_string.syntax().parent_ancestors().find_map(ast::TokenTree::cast)?;
+ let tt = fmt_string.syntax().parent().and_then(ast::TokenTree::cast)?;
45
46
let expanded_t = ast::String::cast(
47
ctx.sema.descend_into_macros_with_kind_preference(fmt_string.syntax().clone()),
0 commit comments