aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-18 13:18:25 +0100
committerGitHub <[email protected]>2021-06-18 13:18:25 +0100
commit7eb843b218b5e10b39a5171f5b9689ec6c2d71c3 (patch)
tree64e3deddd104187ff8aa9b5dd9c64819a5378f1d /crates/ide_assists
parent86c3c42d8ed060b66df95f33c20c1f5778c38ee0 (diff)
parent6b1f0057f2dbe48f1c59c8938957daf158e30823 (diff)
Merge #9325
9325: Minor: clippy perf fixes r=matklad a=lnicola Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'crates/ide_assists')
-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)