From 0e4a542cfb366898a4d53701c50ae4d1732d7c53 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 6 Aug 2019 10:50:32 +0200 Subject: rename --- crates/ra_project_model/src/lib.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'crates/ra_project_model') diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index 08e5c1c32..647a1f365 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs @@ -34,20 +34,20 @@ pub enum ProjectWorkspace { Json { project: JsonProject }, } -/// `ProjectRoot` describes a workspace root folder. +/// `PackageRoot` describes a package root folder. /// Which may be an external dependency, or a member of /// the current workspace. #[derive(Clone)] -pub struct ProjectRoot { +pub struct PackageRoot { /// Path to the root folder path: PathBuf, /// Is a member of the current workspace is_member: bool, } -impl ProjectRoot { - pub fn new(path: PathBuf, is_member: bool) -> ProjectRoot { - ProjectRoot { path, is_member } +impl PackageRoot { + pub fn new(path: PathBuf, is_member: bool) -> PackageRoot { + PackageRoot { path, is_member } } pub fn path(&self) -> &PathBuf { @@ -99,15 +99,15 @@ impl ProjectWorkspace { } } - /// Returns the roots for the current ProjectWorkspace + /// Returns the roots for the current `ProjectWorkspace` /// The return type contains the path and whether or not /// the root is a member of the current workspace - pub fn to_roots(&self) -> Vec { + pub fn to_roots(&self) -> Vec { match self { ProjectWorkspace::Json { project } => { let mut roots = Vec::with_capacity(project.roots.len()); for root in &project.roots { - roots.push(ProjectRoot::new(root.path.clone(), true)); + roots.push(PackageRoot::new(root.path.clone(), true)); } roots } @@ -117,10 +117,10 @@ impl ProjectWorkspace { for pkg in cargo.packages() { let root = pkg.root(&cargo).to_path_buf(); let member = pkg.is_member(&cargo); - roots.push(ProjectRoot::new(root, member)); + roots.push(PackageRoot::new(root, member)); } for krate in sysroot.crates() { - roots.push(ProjectRoot::new(krate.root_dir(&sysroot).to_path_buf(), false)) + roots.push(PackageRoot::new(krate.root_dir(&sysroot).to_path_buf(), false)) } roots } -- cgit v1.2.3