remove more imports

This commit is contained in:
Aleksey Kladov 2018-12-19 12:48:34 +03:00
parent 79596abcaf
commit 6a755ed83a
2 changed files with 2 additions and 23 deletions

View File

@ -4,7 +4,7 @@ use std::{
};
use im;
use ra_analysis::{FileId, FileResolver};
use ra_analysis::{FileId};
use relative_path::RelativePath;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@ -64,27 +64,6 @@ impl PathMap {
}
}
impl FileResolver for PathMap {
fn file_stem(&self, file_id: FileId) -> String {
self.get_path(file_id)
.file_stem()
.unwrap()
.to_str()
.unwrap()
.to_string()
}
fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId> {
let path = path.to_path(&self.get_path(file_id));
let path = normalize(&path);
self.get_id(&path)
}
fn debug_path(&self, file_id: FileId) -> Option<PathBuf> {
Some(self.get_path(file_id).to_owned())
}
}
fn normalize(path: &Path) -> PathBuf {
let mut components = path.components().peekable();
let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() {

View File

@ -6,7 +6,7 @@ use std::{
use languageserver_types::Url;
use ra_analysis::{
Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, FileResolver, LibraryData,
Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, LibraryData,
};
use rustc_hash::FxHashMap;
use failure::{bail, format_err};