From c303e6fbdfd8d04b645796489766e912d2cb3009 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 6 Jan 2019 16:05:59 +0300 Subject: fix ra_analysis to work with the new API --- crates/ra_analysis/src/runnables.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/ra_analysis/src/runnables.rs') diff --git a/crates/ra_analysis/src/runnables.rs b/crates/ra_analysis/src/runnables.rs index f24aa514a..216209098 100644 --- a/crates/ra_analysis/src/runnables.rs +++ b/crates/ra_analysis/src/runnables.rs @@ -72,12 +72,15 @@ fn runnable_mod(db: &RootDatabase, file_id: FileId, module: ast::Module) -> Opti let range = module.syntax().range(); let module = hir::source_binder::module_from_child_node(db, file_id, module.syntax()).ok()??; + + // FIXME: thread cancellation instead of `.ok`ing let path = module .path_to_root(db) .ok()? .into_iter() .rev() - .filter_map(|it| it.name(db).map(Clone::clone)) + .filter_map(|it| it.name(db).ok()) + .filter_map(|it| it) .join("::"); Some(Runnable { range, -- cgit v1.2.3