Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Sep 5, 2022
1 parent eb038d7 commit 57fa565
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ fn main() {
debug!("command = {:?}", command);

if cfg!(target_os = "windows") {
Command::new("cmd").args(&["/C", command.as_str()]).output().expect("failed to execute process");
Command::new("cmd").args(["/C", command.as_str()]).output().expect("failed to execute process");
} else {
let _ =
Command::new("sh").arg("-c").arg(command).spawn().expect("failed to execute process").wait_with_output();
Expand Down
4 changes: 3 additions & 1 deletion lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::{
const CACHE_FILE: &str = "srtool-tag-latest.txt";

/// Fetch the latest image tag
#[allow(clippy::result_large_err)]
pub fn fetch_image_tag() -> Result<String, ureq::Error> {
debug!("Fetching latest version from github");
let url = "https://raw.githubusercontent.com/paritytech/srtool/master/RUSTC_VERSION";
Expand All @@ -19,6 +20,7 @@ pub fn fetch_image_tag() -> Result<String, ureq::Error> {
}

/// Get the latest image. it is fetched from cache we have a version that is younger than `cache_validity` in seconds.
#[allow(clippy::result_large_err)]
pub fn get_image_tag(cache_validity: Option<u64>) -> Result<String, ureq::Error> {
let env_tag = env::var("SRTOOL_TAG");
if let Ok(tag) = env_tag {
Expand Down Expand Up @@ -76,7 +78,7 @@ pub fn get_image_digest(image: &str, tag: &str) -> Option<String> {
let command = format!("docker inspect {image}:{tag}", image = image, tag = tag);

let output = if cfg!(target_os = "windows") {
Command::new("cmd").args(&["/C", command.as_str()]).output()
Command::new("cmd").args(["/C", command.as_str()]).output()
} else {
Command::new("sh").arg("-c").arg(command).output()
};
Expand Down

0 comments on commit 57fa565

Please sign in to comment.