Skip to content

Commit

Permalink
chore(rust): Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Apr 17, 2024
1 parent 3d0c4fd commit 69fa742
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions src/github/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ impl GitHubMatrix {
let include: Vec<GitHubMatrixRow> = systems
.iter()
.flat_map(|system| {
subflakes.0.iter().filter_map(|(k, v)| {
v.can_build_on(&[system.clone()]).then(|| GitHubMatrixRow {
subflakes
.0
.iter()
.filter(|&(_k, v)| v.can_build_on(&[system.clone()]))
.map(|(k, _v)| GitHubMatrixRow {
system: system.clone(),
subflake: k.clone(),
})
})
})
.collect();
GitHubMatrix { include }
Expand Down
4 changes: 2 additions & 2 deletions src/nix/devour_flake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub async fn devour_flake(verbose: bool, args: Vec<String>) -> Result<DevourFlak
let nix = crate::nixcmd().await;
let mut cmd = nix.command();
let devour_flake_url = format!("{}#default", env!("DEVOUR_FLAKE"));
cmd.args(&[
cmd.args([
"build",
&devour_flake_url,
"-L",
Expand Down Expand Up @@ -74,7 +74,7 @@ pub async fn devour_flake(verbose: bool, args: Vec<String>) -> Result<DevourFlak
.context("Unable to spawn devour-flake process")?;
if output.status.success() {
let stdout = String::from_utf8(output.stdout)?;
let v = DevourFlakeOutput::from_str(&stdout.trim())?;
let v = DevourFlakeOutput::from_str(stdout.trim())?;
Ok(v)
} else {
let exit_code = output.status.code().unwrap_or(1);
Expand Down
2 changes: 1 addition & 1 deletion src/nix/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use nix_rs::flake::url::FlakeUrl;
pub async fn nix_flake_lock_check(url: &FlakeUrl) -> Result<()> {
let nix = crate::nixcmd().await;
let mut cmd = nix.command();
cmd.args(&["flake", "lock", "--no-update-lock-file", &url.0]);
cmd.args(["flake", "lock", "--no-update-lock-file", &url.0]);
nix_rs::command::trace_cmd(&cmd);
let status = cmd.stdin(Stdio::null()).spawn()?.wait().await?;
if status.success() {
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod integration_test {
#[tokio::test]
/// A simple test, without config
async fn test_haskell_multi_nix() -> anyhow::Result<()> {
let args = cli::CliArgs::parse_from(&[
let args = cli::CliArgs::parse_from([
"nixci",
"-v",
"build",
Expand All @@ -39,7 +39,7 @@ mod integration_test {
#[tokio::test]
/// A test, with config
async fn test_services_flake() -> anyhow::Result<()> {
let args = cli::CliArgs::parse_from(&[
let args = cli::CliArgs::parse_from([
"nixci",
"-v",
"build",
Expand Down

0 comments on commit 69fa742

Please sign in to comment.