diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_project_model/Cargo.toml | 8 | ||||
-rw-r--r-- | crates/ra_project_model/src/cargo_workspace.rs | 7 | ||||
-rw-r--r-- | crates/ra_project_model/src/lib.rs | 4 | ||||
-rw-r--r-- | crates/ra_project_model/src/sysroot.rs | 6 |
4 files changed, 7 insertions, 18 deletions
diff --git a/crates/ra_project_model/Cargo.toml b/crates/ra_project_model/Cargo.toml index f65aabad7..996dce351 100644 --- a/crates/ra_project_model/Cargo.toml +++ b/crates/ra_project_model/Cargo.toml | |||
@@ -5,21 +5,13 @@ version = "0.1.0" | |||
5 | authors = ["Aleksey Kladov <[email protected]>"] | 5 | authors = ["Aleksey Kladov <[email protected]>"] |
6 | 6 | ||
7 | [dependencies] | 7 | [dependencies] |
8 | # itertools = "0.8.0" | ||
9 | # join_to_string = "0.1.3" | ||
10 | log = "0.4.5" | 8 | log = "0.4.5" |
11 | # relative-path = "0.4.0" | ||
12 | # rayon = "1.0.2" | ||
13 | # fst = "0.3.1" | ||
14 | rustc-hash = "1.0" | 9 | rustc-hash = "1.0" |
15 | # parking_lot = "0.7.0" | ||
16 | # unicase = "2.2.0" | ||
17 | 10 | ||
18 | # TODO get rid of these? | 11 | # TODO get rid of these? |
19 | failure = "0.1.4" | 12 | failure = "0.1.4" |
20 | failure_derive = "0.1.4" | 13 | failure_derive = "0.1.4" |
21 | 14 | ||
22 | smol_str = { version = "0.1.9", features = ["serde"] } | ||
23 | walkdir = "2.2.7" | 15 | walkdir = "2.2.7" |
24 | 16 | ||
25 | cargo_metadata = "0.7.0" | 17 | 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 f3e67d0e5..8adf463a6 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs | |||
@@ -1,7 +1,6 @@ | |||
1 | use std::path::{Path, PathBuf}; | 1 | use std::path::{Path, PathBuf}; |
2 | 2 | ||
3 | use cargo_metadata::{MetadataCommand, CargoOpt}; | 3 | use cargo_metadata::{MetadataCommand, CargoOpt}; |
4 | use smol_str::SmolStr; | ||
5 | use ra_arena::{Arena, RawId, impl_arena_id}; | 4 | use ra_arena::{Arena, RawId, impl_arena_id}; |
6 | use rustc_hash::FxHashMap; | 5 | use rustc_hash::FxHashMap; |
7 | use failure::format_err; | 6 | use failure::format_err; |
@@ -31,7 +30,7 @@ impl_arena_id!(Target); | |||
31 | 30 | ||
32 | #[derive(Debug, Clone)] | 31 | #[derive(Debug, Clone)] |
33 | struct PackageData { | 32 | struct PackageData { |
34 | name: SmolStr, | 33 | name: String, |
35 | manifest: PathBuf, | 34 | manifest: PathBuf, |
36 | targets: Vec<Target>, | 35 | targets: Vec<Target>, |
37 | is_member: bool, | 36 | is_member: bool, |
@@ -41,13 +40,13 @@ struct PackageData { | |||
41 | #[derive(Debug, Clone)] | 40 | #[derive(Debug, Clone)] |
42 | pub struct PackageDependency { | 41 | pub struct PackageDependency { |
43 | pub pkg: Package, | 42 | pub pkg: Package, |
44 | pub name: SmolStr, | 43 | pub name: String, |
45 | } | 44 | } |
46 | 45 | ||
47 | #[derive(Debug, Clone)] | 46 | #[derive(Debug, Clone)] |
48 | struct TargetData { | 47 | struct TargetData { |
49 | pkg: Package, | 48 | pkg: Package, |
50 | name: SmolStr, | 49 | name: String, |
51 | root: PathBuf, | 50 | root: PathBuf, |
52 | kind: TargetKind, | 51 | kind: TargetKind, |
53 | } | 52 | } |
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index 30612ac84..abc79684c 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs | |||
@@ -47,7 +47,7 @@ impl ProjectWorkspace { | |||
47 | if let (Some(&from), Some(&to)) = | 47 | if let (Some(&from), Some(&to)) = |
48 | (sysroot_crates.get(&from), sysroot_crates.get(&to)) | 48 | (sysroot_crates.get(&from), sysroot_crates.get(&to)) |
49 | { | 49 | { |
50 | if let Err(_) = crate_graph.add_dep(from, name.clone(), to) { | 50 | if let Err(_) = crate_graph.add_dep(from, name.into(), to) { |
51 | log::error!("cyclic dependency between sysroot crates") | 51 | log::error!("cyclic dependency between sysroot crates") |
52 | } | 52 | } |
53 | } | 53 | } |
@@ -101,7 +101,7 @@ impl ProjectWorkspace { | |||
101 | for dep in pkg.dependencies(&self.cargo) { | 101 | for dep in pkg.dependencies(&self.cargo) { |
102 | if let Some(&to) = pkg_to_lib_crate.get(&dep.pkg) { | 102 | if let Some(&to) = pkg_to_lib_crate.get(&dep.pkg) { |
103 | for &from in pkg_crates.get(&pkg).into_iter().flatten() { | 103 | for &from in pkg_crates.get(&pkg).into_iter().flatten() { |
104 | if let Err(_) = crate_graph.add_dep(from, dep.name.clone(), to) { | 104 | if let Err(_) = crate_graph.add_dep(from, dep.name.clone().into(), to) { |
105 | log::error!( | 105 | log::error!( |
106 | "cyclic dependency {} -> {}", | 106 | "cyclic dependency {} -> {}", |
107 | pkg.name(&self.cargo), | 107 | pkg.name(&self.cargo), |
diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/ra_project_model/src/sysroot.rs index 18824dbe5..8b87aa7bd 100644 --- a/crates/ra_project_model/src/sysroot.rs +++ b/crates/ra_project_model/src/sysroot.rs | |||
@@ -3,8 +3,6 @@ use std::{ | |||
3 | process::Command, | 3 | process::Command, |
4 | }; | 4 | }; |
5 | 5 | ||
6 | use smol_str::SmolStr; | ||
7 | |||
8 | use ra_arena::{Arena, RawId, impl_arena_id}; | 6 | use ra_arena::{Arena, RawId, impl_arena_id}; |
9 | 7 | ||
10 | use crate::Result; | 8 | use crate::Result; |
@@ -20,7 +18,7 @@ impl_arena_id!(SysrootCrate); | |||
20 | 18 | ||
21 | #[derive(Debug, Clone)] | 19 | #[derive(Debug, Clone)] |
22 | struct SysrootCrateData { | 20 | struct SysrootCrateData { |
23 | name: SmolStr, | 21 | name: String, |
24 | root: PathBuf, | 22 | root: PathBuf, |
25 | deps: Vec<SysrootCrate>, | 23 | deps: Vec<SysrootCrate>, |
26 | } | 24 | } |
@@ -81,7 +79,7 @@ impl Sysroot { | |||
81 | } | 79 | } |
82 | 80 | ||
83 | impl SysrootCrate { | 81 | impl SysrootCrate { |
84 | pub fn name(self, sysroot: &Sysroot) -> &SmolStr { | 82 | pub fn name(self, sysroot: &Sysroot) -> &str { |
85 | &sysroot.crates[self].name | 83 | &sysroot.crates[self].name |
86 | } | 84 | } |
87 | pub fn root(self, sysroot: &Sysroot) -> &Path { | 85 | pub fn root(self, sysroot: &Sysroot) -> &Path { |