From beb81a40eb53d8f79c4e0e404f922ebfaad15425 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 11 Jul 2021 13:45:58 +0300 Subject: [PATCH] simplify --- crates/ide/src/runnables.rs | 10 ---------- crates/rust-analyzer/src/to_proto.rs | 8 +++++++- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs index 22e0a2afd64..51c01ea31dd 100644 --- a/crates/ide/src/runnables.rs +++ b/crates/ide/src/runnables.rs @@ -74,16 +74,6 @@ impl Runnable { } } - pub fn can_debug(&self) -> bool { - match self.kind { - RunnableKind::DocTest { .. } => false, - RunnableKind::TestMod { .. } - | RunnableKind::Test { .. } - | RunnableKind::Bench { .. } - | RunnableKind::Bin => true, - } - } - pub fn title(&self) -> String { let mut s = String::from("▶\u{fe0e} Run "); if self.use_name_in_title { diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index f270d9de95a..94ba4fbaeaf 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -998,7 +998,13 @@ pub(crate) fn code_lens( let annotation_range = range(&line_index, annotation.range); let title = run.title(); - let can_debug = run.can_debug(); + let can_debug = match run.kind { + ide::RunnableKind::DocTest { .. } => false, + ide::RunnableKind::TestMod { .. } + | ide::RunnableKind::Test { .. } + | ide::RunnableKind::Bench { .. } + | ide::RunnableKind::Bin => true, + }; let r = runnable(snap, run)?; let lens_config = snap.config.lens();