diff options
author | Aleksey Kladov <[email protected]> | 2018-09-03 21:32:42 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-09-03 21:32:42 +0100 |
commit | 952da31f44b717d5679c1c0baffcd998c0f67266 (patch) | |
tree | b7006268ca07e0e517b7cc0a62ce7658310ca3e7 /crates/server/src/project_model.rs | |
parent | 971054e4d026a4d39dc6229ba8883bef626b11e3 (diff) |
switch to internal feedback
Diffstat (limited to 'crates/server/src/project_model.rs')
-rw-r--r-- | crates/server/src/project_model.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/server/src/project_model.rs b/crates/server/src/project_model.rs index 517836e62..a712106d9 100644 --- a/crates/server/src/project_model.rs +++ b/crates/server/src/project_model.rs | |||
@@ -11,7 +11,7 @@ use { | |||
11 | thread_watcher::ThreadWatcher, | 11 | thread_watcher::ThreadWatcher, |
12 | }; | 12 | }; |
13 | 13 | ||
14 | #[derive(Debug, Serialize, Clone)] | 14 | #[derive(Debug, Clone)] |
15 | pub struct CargoWorkspace { | 15 | pub struct CargoWorkspace { |
16 | packages: Vec<PackageData>, | 16 | packages: Vec<PackageData>, |
17 | targets: Vec<TargetData>, | 17 | targets: Vec<TargetData>, |
@@ -22,7 +22,7 @@ pub struct Package(usize); | |||
22 | #[derive(Clone, Copy, Debug, Serialize)] | 22 | #[derive(Clone, Copy, Debug, Serialize)] |
23 | pub struct Target(usize); | 23 | pub struct Target(usize); |
24 | 24 | ||
25 | #[derive(Debug, Serialize, Clone)] | 25 | #[derive(Debug, Clone)] |
26 | struct PackageData { | 26 | struct PackageData { |
27 | name: SmolStr, | 27 | name: SmolStr, |
28 | manifest: PathBuf, | 28 | manifest: PathBuf, |
@@ -30,7 +30,7 @@ struct PackageData { | |||
30 | is_member: bool, | 30 | is_member: bool, |
31 | } | 31 | } |
32 | 32 | ||
33 | #[derive(Debug, Serialize, Clone)] | 33 | #[derive(Debug, Clone)] |
34 | struct TargetData { | 34 | struct TargetData { |
35 | pkg: Package, | 35 | pkg: Package, |
36 | name: SmolStr, | 36 | name: SmolStr, |
@@ -38,7 +38,7 @@ struct TargetData { | |||
38 | kind: TargetKind, | 38 | kind: TargetKind, |
39 | } | 39 | } |
40 | 40 | ||
41 | #[derive(Debug, Serialize, Clone, Copy, PartialEq, Eq)] | 41 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
42 | pub enum TargetKind { | 42 | pub enum TargetKind { |
43 | Bin, Lib, Example, Test, Bench, Other, | 43 | Bin, Lib, Example, Test, Bench, Other, |
44 | } | 44 | } |
@@ -47,9 +47,6 @@ impl Package { | |||
47 | pub fn name(self, ws: &CargoWorkspace) -> &str { | 47 | pub fn name(self, ws: &CargoWorkspace) -> &str { |
48 | ws.pkg(self).name.as_str() | 48 | ws.pkg(self).name.as_str() |
49 | } | 49 | } |
50 | pub fn manifest(self, ws: &CargoWorkspace) -> &Path { | ||
51 | ws.pkg(self).manifest.as_path() | ||
52 | } | ||
53 | pub fn root(self, ws: &CargoWorkspace) -> &Path { | 50 | pub fn root(self, ws: &CargoWorkspace) -> &Path { |
54 | ws.pkg(self).manifest.parent().unwrap() | 51 | ws.pkg(self).manifest.parent().unwrap() |
55 | } | 52 | } |