aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/handlers
diff options
context:
space:
mode:
authorLaurenČ›iu Nicola <[email protected]>2021-06-18 12:40:51 +0100
committerLaurenČ›iu Nicola <[email protected]>2021-06-18 12:40:51 +0100
commite3ce88f6f25901b1d33fbc5f931a9d8f90b9e2b8 (patch)
treec6876d5f81bafe5d405f7ab72ff61e4a748a3bc5 /crates/ide_assists/src/handlers
parent0d863ccea96c6c3256fad12807a0eedbfccd8294 (diff)
Minor clippy perf fixes
Diffstat (limited to 'crates/ide_assists/src/handlers')
-rw-r--r--crates/ide_assists/src/handlers/remove_dbg.rs4
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)