aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
authorivan770 <[email protected]>2020-12-10 16:10:39 +0000
committerivan770 <[email protected]>2020-12-10 16:10:39 +0000
commitbbb0bc7b041278480edbfaa7c3cdadc5a704fc03 (patch)
treeba9a6ca1097cdce52d4d701effaabf8e1e2868fd /crates/ide/src
parent35006eba79b9a445c4ebec66f1a93b3170398e0e (diff)
Cast to ExprStmt, style fixes
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/diagnostics/fixes.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs
index c235b5bf4..ba046232a 100644
--- a/crates/ide/src/diagnostics/fixes.rs
+++ b/crates/ide/src/diagnostics/fixes.rs
@@ -16,7 +16,7 @@ use ide_db::{
16use syntax::{ 16use syntax::{
17 algo, 17 algo,
18 ast::{self, edit::IndentLevel, make}, 18 ast::{self, edit::IndentLevel, make},
19 AstNode, Direction, T, 19 AstNode,
20}; 20};
21use text_edit::TextEdit; 21use text_edit::TextEdit;
22 22
@@ -110,9 +110,9 @@ impl DiagnosticWithFix for RemoveThisSemicolon {
110 .expr 110 .expr
111 .to_node(&root) 111 .to_node(&root)
112 .syntax() 112 .syntax()
113 .siblings_with_tokens(Direction::Next) 113 .parent()
114 .filter_map(|it| it.into_token()) 114 .and_then(ast::ExprStmt::cast)
115 .find(|it| it.kind() == T![;])? 115 .and_then(|expr| expr.semicolon_token())?
116 .text_range(); 116 .text_range();
117 117
118 let edit = TextEdit::delete(semicolon); 118 let edit = TextEdit::delete(semicolon);