diff --git a/Cargo.lock b/Cargo.lock index 3f0334f95d..a76d0b2fe9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1057,7 +1057,6 @@ dependencies = [ "ra_db 0.1.0", "ra_vfs 0.1.0", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "smol_str 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "test_utils 0.1.0", "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/crates/ra_project_model/Cargo.toml b/crates/ra_project_model/Cargo.toml index f65aabad79..996dce351e 100644 --- a/crates/ra_project_model/Cargo.toml +++ b/crates/ra_project_model/Cargo.toml @@ -5,21 +5,13 @@ version = "0.1.0" authors = ["Aleksey Kladov "] [dependencies] -# itertools = "0.8.0" -# join_to_string = "0.1.3" log = "0.4.5" -# relative-path = "0.4.0" -# rayon = "1.0.2" -# fst = "0.3.1" rustc-hash = "1.0" -# parking_lot = "0.7.0" -# unicase = "2.2.0" # TODO get rid of these? failure = "0.1.4" failure_derive = "0.1.4" -smol_str = { version = "0.1.9", features = ["serde"] } walkdir = "2.2.7" cargo_metadata = "0.7.0" diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index f3e67d0e54..8adf463a6e 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs @@ -1,7 +1,6 @@ use std::path::{Path, PathBuf}; use cargo_metadata::{MetadataCommand, CargoOpt}; -use smol_str::SmolStr; use ra_arena::{Arena, RawId, impl_arena_id}; use rustc_hash::FxHashMap; use failure::format_err; @@ -31,7 +30,7 @@ impl_arena_id!(Target); #[derive(Debug, Clone)] struct PackageData { - name: SmolStr, + name: String, manifest: PathBuf, targets: Vec, is_member: bool, @@ -41,13 +40,13 @@ struct PackageData { #[derive(Debug, Clone)] pub struct PackageDependency { pub pkg: Package, - pub name: SmolStr, + pub name: String, } #[derive(Debug, Clone)] struct TargetData { pkg: Package, - name: SmolStr, + name: String, root: PathBuf, kind: TargetKind, } diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index 30612ac845..abc79684c5 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs @@ -47,7 +47,7 @@ impl ProjectWorkspace { if let (Some(&from), Some(&to)) = (sysroot_crates.get(&from), sysroot_crates.get(&to)) { - if let Err(_) = crate_graph.add_dep(from, name.clone(), to) { + if let Err(_) = crate_graph.add_dep(from, name.into(), to) { log::error!("cyclic dependency between sysroot crates") } } @@ -101,7 +101,7 @@ impl ProjectWorkspace { for dep in pkg.dependencies(&self.cargo) { if let Some(&to) = pkg_to_lib_crate.get(&dep.pkg) { for &from in pkg_crates.get(&pkg).into_iter().flatten() { - if let Err(_) = crate_graph.add_dep(from, dep.name.clone(), to) { + if let Err(_) = crate_graph.add_dep(from, dep.name.clone().into(), to) { log::error!( "cyclic dependency {} -> {}", pkg.name(&self.cargo), diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/ra_project_model/src/sysroot.rs index 18824dbe57..8b87aa7bda 100644 --- a/crates/ra_project_model/src/sysroot.rs +++ b/crates/ra_project_model/src/sysroot.rs @@ -3,8 +3,6 @@ use std::{ process::Command, }; -use smol_str::SmolStr; - use ra_arena::{Arena, RawId, impl_arena_id}; use crate::Result; @@ -20,7 +18,7 @@ impl_arena_id!(SysrootCrate); #[derive(Debug, Clone)] struct SysrootCrateData { - name: SmolStr, + name: String, root: PathBuf, deps: Vec, } @@ -81,7 +79,7 @@ impl Sysroot { } impl SysrootCrate { - pub fn name(self, sysroot: &Sysroot) -> &SmolStr { + pub fn name(self, sysroot: &Sysroot) -> &str { &sysroot.crates[self].name } pub fn root(self, sysroot: &Sysroot) -> &Path {