From b57e2011f47bb97d8b90d76a47b8f736f3e532a8 Mon Sep 17 00:00:00 2001 From: Will Bush Date: Wed, 30 Oct 2024 12:38:52 -0500 Subject: [PATCH] Revert "lint: fix check_* functions (clippy::module_name_repetitions)" This reverts commit f8883392de7a564c6202cecb85e9494e5c76f5fa. --- src/main.rs | 3 ++- src/references.rs | 2 +- src/structure.rs | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) 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),