diff options
Diffstat (limited to 'crates/ide_assists')
-rw-r--r-- | crates/ide_assists/src/handlers/remove_dbg.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_assists/src/handlers/remove_dbg.rs b/crates/ide_assists/src/handlers/remove_dbg.rs index b20fe992d..5866d8974 100644 --- a/crates/ide_assists/src/handlers/remove_dbg.rs +++ b/crates/ide_assists/src/handlers/remove_dbg.rs | |||
@@ -35,14 +35,14 @@ pub(crate) fn remove_dbg(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | |||
35 | .prev_sibling_or_token() | 35 | .prev_sibling_or_token() |
36 | .and_then(whitespace_start) | 36 | .and_then(whitespace_start) |
37 | .map(|start| TextRange::new(start, macro_call.syntax().text_range().end())) | 37 | .map(|start| TextRange::new(start, macro_call.syntax().text_range().end())) |
38 | .unwrap_or(macro_call.syntax().text_range()) | 38 | .unwrap_or_else(|| macro_call.syntax().text_range()) |
39 | }, | 39 | }, |
40 | ast::ExprStmt(it) => { | 40 | ast::ExprStmt(it) => { |
41 | let start = it | 41 | let start = it |
42 | .syntax() | 42 | .syntax() |
43 | .prev_sibling_or_token() | 43 | .prev_sibling_or_token() |
44 | .and_then(whitespace_start) | 44 | .and_then(whitespace_start) |
45 | .unwrap_or(it.syntax().text_range().start()); | 45 | .unwrap_or_else(|| it.syntax().text_range().start()); |
46 | let end = it.syntax().text_range().end(); | 46 | let end = it.syntax().text_range().end(); |
47 | 47 | ||
48 | TextRange::new(start, end) | 48 | TextRange::new(start, end) |