Skip to content

Commit 54e9324

Browse files
kartvaVeykril
andauthored
Update crates/ide-assists/src/handlers/move_format_string_arg.rs
Co-authored-by: Lukas Wirth <[email protected]>
1 parent fb5ae99 commit 54e9324

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/ide-assists/src/handlers/move_format_string_arg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use syntax::{ast, AstNode, AstToken, NodeOrToken, SyntaxKind::COMMA, TextRange};
4141

4242
pub(crate) fn move_format_string_arg(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> {
4343
let fmt_string = ctx.find_token_at_offset::<ast::String>()?;
44-
let tt = fmt_string.syntax().parent_ancestors().find_map(ast::TokenTree::cast)?;
44+
let tt = fmt_string.syntax().parent().and_then(ast::TokenTree::cast)?;
4545

4646
let expanded_t = ast::String::cast(
4747
ctx.sema.descend_into_macros_with_kind_preference(fmt_string.syntax().clone()),

0 commit comments

Comments
 (0)