Skip to content

Commit

Permalink
Remove DiscoveredManifest.depth (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethloeffler authored Apr 23, 2024
1 parent d41b102 commit 3fb7d6c
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/discovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ where
#[derive(Debug, Clone)]
pub struct DiscoveredManifest {
_kind: ManifestKind,
pub depth: usize,
pub path: PathBuf,
pub tools: HashMap<ToolAlias, ToolSpec>,
}
Expand Down Expand Up @@ -104,7 +103,6 @@ fn search_paths(cwd: &Path, rokit_only: bool, skip_home: bool) -> Vec<(ManifestK
*/
pub async fn discover_all_manifests(rokit_only: bool, skip_home: bool) -> Vec<DiscoveredManifest> {
let cwd = current_dir().await;
let cwd_depth = cwd.components().count();

let found_manifest_contents = search_paths(&cwd, rokit_only, skip_home)
.into_iter()
Expand All @@ -127,11 +125,8 @@ pub async fn discover_all_manifests(rokit_only: bool, skip_home: bool) -> Vec<Di
ManifestKind::Aftman => AftmanManifest::parse_manifest(&contents)?.into_tools(),
ManifestKind::Foreman => ForemanManifest::parse_manifest(&contents)?.into_tools(),
};
let path_depth = path.components().count();
let depth = cwd_depth - path_depth;
Some(DiscoveredManifest {
_kind: kind,
depth,
path,
tools,
})
Expand Down

0 comments on commit 3fb7d6c

Please sign in to comment.