aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-02-09 09:51:06 +0000
committerFlorian Diebold <[email protected]>2019-02-09 10:15:25 +0000
commit12c70871cca736afa44379e59f8573c60b0ccd0a (patch)
tree189d7482e74c54b9ee2f3bb05dc7207c4e424cb0 /crates
parentddbf43b630fa8159ab2ea5e959393bff44e0c73b (diff)
Remove SmolStr from project model
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_project_model/Cargo.toml8
-rw-r--r--crates/ra_project_model/src/cargo_workspace.rs7
-rw-r--r--crates/ra_project_model/src/lib.rs4
-rw-r--r--crates/ra_project_model/src/sysroot.rs6
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"
5authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]
6 6
7[dependencies] 7[dependencies]
8# itertools = "0.8.0"
9# join_to_string = "0.1.3"
10log = "0.4.5" 8log = "0.4.5"
11# relative-path = "0.4.0"
12# rayon = "1.0.2"
13# fst = "0.3.1"
14rustc-hash = "1.0" 9rustc-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?
19failure = "0.1.4" 12failure = "0.1.4"
20failure_derive = "0.1.4" 13failure_derive = "0.1.4"
21 14
22smol_str = { version = "0.1.9", features = ["serde"] }
23walkdir = "2.2.7" 15walkdir = "2.2.7"
24 16
25cargo_metadata = "0.7.0" 17cargo_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 @@
1use std::path::{Path, PathBuf}; 1use std::path::{Path, PathBuf};
2 2
3use cargo_metadata::{MetadataCommand, CargoOpt}; 3use cargo_metadata::{MetadataCommand, CargoOpt};
4use smol_str::SmolStr;
5use ra_arena::{Arena, RawId, impl_arena_id}; 4use ra_arena::{Arena, RawId, impl_arena_id};
6use rustc_hash::FxHashMap; 5use rustc_hash::FxHashMap;
7use failure::format_err; 6use failure::format_err;
@@ -31,7 +30,7 @@ impl_arena_id!(Target);
31 30
32#[derive(Debug, Clone)] 31#[derive(Debug, Clone)]
33struct PackageData { 32struct 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)]
42pub struct PackageDependency { 41pub 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)]
48struct TargetData { 47struct 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
6use smol_str::SmolStr;
7
8use ra_arena::{Arena, RawId, impl_arena_id}; 6use ra_arena::{Arena, RawId, impl_arena_id};
9 7
10use crate::Result; 8use crate::Result;
@@ -20,7 +18,7 @@ impl_arena_id!(SysrootCrate);
20 18
21#[derive(Debug, Clone)] 19#[derive(Debug, Clone)]
22struct SysrootCrateData { 20struct 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
83impl SysrootCrate { 81impl 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 {