Skip to content

Commit

Permalink
Fix for clippy errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexhuszagh committed Jun 8, 2022
1 parent f696978 commit ac1112d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions cross-dev/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![deny(missing_debug_implementations, rust_2018_idioms)]

use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};

use clap::{Parser, Subcommand};
Expand Down Expand Up @@ -115,7 +115,7 @@ fn format_image(registry: &str, repository: &str, target: &str, tag: &str) -> St
output
}

fn pull_image(engine: &PathBuf, image: &str, verbose: bool) -> cross::Result<()> {
fn pull_image(engine: &Path, image: &str, verbose: bool) -> cross::Result<()> {
let mut command = Command::new(engine);
command.arg("pull");
command.arg(image);
Expand All @@ -127,7 +127,7 @@ fn pull_image(engine: &PathBuf, image: &str, verbose: bool) -> cross::Result<()>
command.run(verbose)
}

fn image_info(engine: &PathBuf, target: &str, image: &str, tag: &str, verbose: bool) -> cross::Result<()> {
fn image_info(engine: &Path, target: &str, image: &str, tag: &str, verbose: bool) -> cross::Result<()> {
if !tag.starts_with("local") {
pull_image(engine, image, verbose)?;
}
Expand All @@ -149,7 +149,7 @@ fn image_info(engine: &PathBuf, target: &str, image: &str, tag: &str, verbose: b

fn target_info(
mut targets: Vec<String>,
engine: &PathBuf,
engine: &Path,
verbose: bool,
registry: &str,
repository: &str,
Expand All @@ -162,7 +162,7 @@ fn target_info(
targets = matrix
.iter()
.map(|t| t.target.clone())
.filter(|t| target_has_image(&t))
.filter(|t| target_has_image(t))
.collect();
}

Expand Down
12 changes: 6 additions & 6 deletions src/bin/cross-util.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![deny(missing_debug_implementations, rust_2018_idioms)]

use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::process::Command;

use clap::{Parser, Subcommand};
Expand Down Expand Up @@ -68,7 +68,7 @@ fn is_local_image(image: &str) -> bool {
tag.starts_with("local")
}

fn get_cross_images(engine: &PathBuf, verbose: bool, local: bool) -> cross::Result<Vec<String>> {
fn get_cross_images(engine: &Path, verbose: bool, local: bool) -> cross::Result<Vec<String>> {
let stdout = Command::new(engine)
.arg("images")
.arg("--format")
Expand Down Expand Up @@ -119,7 +119,7 @@ fn get_image_target(image: &str) -> cross::Result<String> {
}
}

fn list_images(engine: &PathBuf, verbose: bool) -> cross::Result<()> {
fn list_images(engine: &Path, verbose: bool) -> cross::Result<()> {
get_cross_images(engine, verbose, true)?
.iter()
.for_each(|line| println!("{}", line));
Expand All @@ -128,7 +128,7 @@ fn list_images(engine: &PathBuf, verbose: bool) -> cross::Result<()> {
}

fn remove_images(
engine: &PathBuf,
engine: &Path,
images: &[String],
verbose: bool,
force: bool,
Expand All @@ -143,7 +143,7 @@ fn remove_images(
}

fn remove_all_images(
engine: &PathBuf,
engine: &Path,
verbose: bool,
force: bool,
local: bool,
Expand All @@ -153,7 +153,7 @@ fn remove_all_images(
}

fn remove_target_images(
engine: &PathBuf,
engine: &Path,
targets: &[String],
verbose: bool,
force: bool,
Expand Down

0 comments on commit ac1112d

Please sign in to comment.