diff --git a/src/main.rs b/src/main.rs index ee53f1c..4f2a459 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,6 +21,7 @@ use std::{panic, thread}; use crate::nix_file::NixFileStore; use crate::status::{ColoredStatus, Status}; +use crate::structure::check_structure; use crate::validation::Validation::Failure; use crate::validation::Validation::Success; @@ -112,7 +113,7 @@ fn check_nixpkgs(nixpkgs_path: &Path) -> validation::Result { } let mut nix_file_store = NixFileStore::default(); - let structure = structure::check(&nixpkgs_path, &mut nix_file_store)?; + let structure = check_structure(&nixpkgs_path, &mut nix_file_store)?; // Only if we could successfully parse the structure, we do the evaluation checks let result = structure.result_map(|package_names| { diff --git a/src/references.rs b/src/references.rs index aa8bc44..c429da3 100644 --- a/src/references.rs +++ b/src/references.rs @@ -13,7 +13,7 @@ use crate::NixFileStore; /// Check that every package directory in pkgs/by-name doesn't link to outside that directory. /// Both symlinks and Nix path expressions are checked. -pub fn check( +pub fn check_references( nix_file_store: &mut NixFileStore, relative_package_dir: &RelativePath, absolute_package_dir: &Path, diff --git a/src/structure.rs b/src/structure.rs index 7d88826..2f3544a 100644 --- a/src/structure.rs +++ b/src/structure.rs @@ -52,7 +52,10 @@ pub fn relative_file_for_package(package_name: &str) -> RelativePathBuf { /// Check the structure of Nixpkgs, returning the attribute names that are defined in /// `pkgs/by-name` -pub fn check(path: &Path, nix_file_store: &mut NixFileStore) -> validation::Result> { +pub fn check_structure( + path: &Path, + nix_file_store: &mut NixFileStore, +) -> validation::Result> { let base_dir = path.join(BASE_SUBPATH); let shard_results = read_dir_sorted(&base_dir)? @@ -167,7 +170,7 @@ fn check_package( Success(()) }); - let result = result.and(references::check( + let result = result.and(references::check_references( nix_file_store, &relative_package_dir, &relative_package_dir.to_path(path),