Skip to content

Commit

Permalink
Remove unnecessary API methods from Project
Browse files Browse the repository at this point in the history
  • Loading branch information
charlespierce committed Jun 1, 2020
1 parent ea84cca commit 0657535
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
13 changes: 0 additions & 13 deletions crates/volta-core/src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,6 @@ impl Project {
.into())
}
}

// TODO: Remove these once the changes to `volta list` are merged
pub fn matching_bin(&self, _bin: &OsStr, _version: &Version) -> Fallible<Option<BinConfig>> {
Ok(None)
}

pub fn package_file(&self) -> PathBuf {
self.manifest_file.clone()
}

pub fn has_dependency(&self, _dep: &str, _version: &Version) -> bool {
false
}
}

fn is_node_root(dir: &Path) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/command/list/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl Package {
fn source(name: &str, project: Option<&Project>) -> Source {
match project {
Some(project) if project.has_direct_dependency(name) => {
Source::Project(project.package_file())
Source::Project(project.manifest_file().to_owned())
}
_ => Source::Default,
}
Expand Down
6 changes: 3 additions & 3 deletions src/command/list/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Lookup {
.and_then(self.version_from_spec())
.and_then(|project_version| {
if &project_version == version {
Some(Source::Project(project.package_file()))
Some(Source::Project(project.manifest_file().to_owned()))
} else {
None
}
Expand Down Expand Up @@ -90,7 +90,7 @@ impl Lookup {
Some(project) => project
.platform()
.and_then(self.version_from_spec())
.map(|version| (Source::Project(project.package_file()), version)),
.map(|version| (Source::Project(project.manifest_file().to_owned()), version)),
None => default
.clone()
.and_then(self.version_from_spec())
Expand All @@ -104,7 +104,7 @@ fn tool_source(name: &str, project: Option<&Project>) -> Fallible<Source> {
match project {
Some(project) => {
if project.has_direct_bin(name.as_ref())? {
Ok(Source::Project(project.package_file()))
Ok(Source::Project(project.manifest_file().to_owned()))
} else {
Ok(Source::Default)
}
Expand Down

0 comments on commit 0657535

Please sign in to comment.