From e3ce88f6f25901b1d33fbc5f931a9d8f90b9e2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Fri, 18 Jun 2021 14:40:51 +0300 Subject: Minor clippy perf fixes --- crates/ide_assists/src/handlers/remove_dbg.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ide_assists') 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<()> { .prev_sibling_or_token() .and_then(whitespace_start) .map(|start| TextRange::new(start, macro_call.syntax().text_range().end())) - .unwrap_or(macro_call.syntax().text_range()) + .unwrap_or_else(|| macro_call.syntax().text_range()) }, ast::ExprStmt(it) => { let start = it .syntax() .prev_sibling_or_token() .and_then(whitespace_start) - .unwrap_or(it.syntax().text_range().start()); + .unwrap_or_else(|| it.syntax().text_range().start()); let end = it.syntax().text_range().end(); TextRange::new(start, end) -- cgit v1.2.3