diff --git a/src/lib.rs b/src/lib.rs index 7c07e6b..e556901 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -240,7 +240,7 @@ fn find_repos_without_details(path: &Path) -> Option> { Some(repos) } -fn find_repos(root: &Path, at_root: bool) -> Option> { +fn find_repos(root: &Path) -> Option> { let mut repos: Vec = Vec::new(); for path in find_repos_without_details(root).unwrap() { @@ -321,7 +321,7 @@ fn find_repos(root: &Path, at_root: bool) -> Option> { }; repos.push(Repo { - name: match at_root { + name: match path == root { true => match &root.parent() { Some(parent) => path_as_string(path.strip_prefix(parent).unwrap()), None => { @@ -338,7 +338,7 @@ fn find_repos(root: &Path, at_root: bool) -> Option> { } fn find_in_tree(path: &Path) -> Option { - let repos: Vec = match find_repos(path, true) { + let repos: Vec = match find_repos(path) { Some(vec) => vec, None => Vec::new(), };