From a4f934efa8e37d3bc822575109d103998ecd8fe1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 28 Jun 2020 01:23:32 +0200 Subject: [PATCH] Update crates/rust-analyzer/src/handlers.rs Co-authored-by: Veetaha --- crates/rust-analyzer/src/handlers.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 4d0684b2a3..615aa2eb0a 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -413,9 +413,7 @@ pub(crate) fn handle_runnables( Some(offset) => { let source_file = snap.analysis.parse(file_id)?; algo::find_node_at_offset::(source_file.syntax(), offset) - .and_then(|it| it.path()) - .and_then(|it| it.segment()) - .and_then(|it| it.name_ref()) + .and_then(|it| it.path()?.segment()?.name_ref()) .map_or(false, |it| it.text() == "expect") } None => false,