Skip to content

Commit

Permalink
lint: fix check_* functions (clippy::module_name_repetitions)
Browse files Browse the repository at this point in the history
  • Loading branch information
willbush committed Oct 30, 2024
1 parent 93685f3 commit f888339
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ 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;

Expand Down Expand Up @@ -115,7 +114,7 @@ fn check_nixpkgs(nixpkgs_path: &Path) -> validation::Result<ratchet::Nixpkgs> {
}

let mut nix_file_store = NixFileStore::default();
let structure = check_structure(&nixpkgs_path, &mut nix_file_store)?;
let structure = structure::check(&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| {
Expand Down
2 changes: 1 addition & 1 deletion src/references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_references(
pub fn check(
nix_file_store: &mut NixFileStore,
relative_package_dir: &RelativePath,
absolute_package_dir: &Path,
Expand Down
4 changes: 2 additions & 2 deletions src/structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ 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_structure(
pub fn check(
path: &Path,
nix_file_store: &mut NixFileStore,
) -> validation::Result<Vec<String>> {
Expand Down Expand Up @@ -170,7 +170,7 @@ fn check_package(
Success(())
});

let result = result.and(references::check_references(
let result = result.and(references::check(
nix_file_store,
&relative_package_dir,
&relative_package_dir.to_path(path),
Expand Down

0 comments on commit f888339

Please sign in to comment.