assists/inline: remove let-in check early return

This commit is contained in:
Léana 江 2025-08-09 23:53:41 +02:00
parent d86634aaec
commit 763b72cf95
No known key found for this signature in database
GPG key ID: 4E887A4CA9714ADA

View file

@ -69,7 +69,11 @@ pub(super) fn inline(ctx: &mut AssistsCtx<'_>) -> Option<()> {
_ => None,
});
let is_letin = ast::LetIn::cast(path_value.syntax().parent()?).is_some();
let is_letin = path_value
.syntax()
.parent()
.and_then(ast::LetIn::cast)
.is_some();
if is_letin {
rewrites.push(TextEdit {
delete: path_value.syntax().text_range(),