refactor: handle clippy lints
All checks were successful
conventional commits / conventional commits (push) Successful in 13s
build / run (push) Successful in 1m1s
check / run (push) Successful in 1m50s

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
Christina Sørensen 2024-09-13 07:16:34 +02:00
parent cb34302e17
commit 85a6d6cc9a
Signed by: cafkafk
GPG key ID: 26C542FD97F965CE
2 changed files with 3 additions and 8 deletions

View file

@ -6,7 +6,6 @@
use clap::{arg, command, crate_authors, value_parser, ArgAction, Command};
const DEFAULT_CACHE: &str = "cache.nixos.org";
const DEFAULT_INSTALLABLE: &str = "./#nixosConfigurations.{}.config.system.build.toplevel";
pub fn build_cli() -> Command {
command!()

View file

@ -29,11 +29,7 @@ fn get_config_drv_path(host: &str, config_dir: &str) -> std::io::Result<std::pro
/// Get installable derivation path
#[inline]
fn get_installable_drv_path(
host: &str,
config_dir: &str,
installable: &str,
) -> std::io::Result<std::process::Output> {
fn get_installable_drv_path(installable: &str) -> std::io::Result<std::process::Output> {
Command::new("nix")
.args(["build", "--quiet", installable, "--dry-run", "--json"])
.output()
@ -69,9 +65,9 @@ fn requisites_to_hashes(
pub fn get_requisites(host: &str, config_dir: &str, installable: Option<String>) -> String {
// If the users specified an installable, we interpret that, instead of trying
// to guess their config location.
let mut drv_path;
let drv_path;
if let Some(installable) = installable {
drv_path = get_installable_drv_path(host, config_dir, &installable).unwrap();
drv_path = get_installable_drv_path(&installable).unwrap();
} else {
drv_path = get_config_drv_path(host, config_dir).unwrap();
}