From 154bce18644698f4e8ef2a2ad2bdd853f2f1e31c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 27 Jan 2019 18:07:45 +0300 Subject: remove dead code --- crates/ra_ide_api/src/mock_analysis.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide_api/src/mock_analysis.rs index 846c76cfe..0f2d22ab2 100644 --- a/crates/ra_ide_api/src/mock_analysis.rs +++ b/crates/ra_ide_api/src/mock_analysis.rs @@ -2,7 +2,6 @@ use std::sync::Arc; use relative_path::RelativePathBuf; use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER}; -use ra_db::mock::FileMap; use crate::{Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, FilePosition, FileRange, SourceRootId}; @@ -83,15 +82,14 @@ impl MockAnalysis { } pub fn analysis_host(self) -> AnalysisHost { let mut host = AnalysisHost::default(); - let mut file_map = FileMap::default(); let source_root = SourceRootId(0); let mut change = AnalysisChange::new(); change.add_root(source_root, true); let mut crate_graph = CrateGraph::default(); - for (path, contents) in self.files.into_iter() { + for (i, (path, contents)) in self.files.into_iter().enumerate() { assert!(path.starts_with('/')); let path = RelativePathBuf::from_path(&path[1..]).unwrap(); - let file_id = file_map.add(path.clone()); + let file_id = FileId(i as u32 + 1); if path == "/lib.rs" || path == "/main.rs" { crate_graph.add_crate_root(file_id); } -- cgit v1.2.3