From ea8324a0108b666ce03c9c90ea186f10a72c6f29 Mon Sep 17 00:00:00 2001 From: Alexander Gil Date: Tue, 27 Jun 2023 16:36:35 +0200 Subject: [PATCH] build: Upgrade to Rust 1.70 and fix new clippy warnings Signed-off-by: Alexander Gil --- Cargo.toml | 2 +- Dockerfile | 2 +- rash_core/src/docopt/mod.rs | 1 - rash_core/src/docopt/options.rs | 1 - rash_core/src/modules/find.rs | 9 ++------- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7786702b..b6eff174 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ [workspace.package] version = "1.8.6" authors = ["Pando85 "] -rust-version = "1.67" +rust-version = "1.70" edition = "2021" license-file = "LICENSE" homepage = "https://rash.sh" diff --git a/Dockerfile b/Dockerfile index 806085a4..e365e2a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=rust:1.67.0 +ARG BASE_IMAGE=rust:1.70.0 FROM ${BASE_IMAGE} AS builder LABEL mantainer pando855@gmail.com diff --git a/rash_core/src/docopt/mod.rs b/rash_core/src/docopt/mod.rs index 27fabba3..0d8a11ba 100644 --- a/rash_core/src/docopt/mod.rs +++ b/rash_core/src/docopt/mod.rs @@ -189,7 +189,6 @@ pub fn parse(file: &str, args: &[&str]) -> Result { fn parse_help(file: &str) -> String { let re = Regex::new(r"#(.*)").unwrap(); file.split('\n') - .into_iter() // skip first empty line cause split .skip(1) .map_while(|line| re.captures(line)) diff --git a/rash_core/src/docopt/options.rs b/rash_core/src/docopt/options.rs index fc379082..f3d9baf1 100644 --- a/rash_core/src/docopt/options.rs +++ b/rash_core/src/docopt/options.rs @@ -246,7 +246,6 @@ impl Options { pub fn parse_doc(doc: &str, usages: &[String]) -> Result { let mut description_options = Options::new( doc.split('\n') - .into_iter() .filter_map(|line| { let trimmed = line.trim_start(); if trimmed.starts_with('-') { diff --git a/rash_core/src/modules/find.rs b/rash_core/src/modules/find.rs index e5097a69..0c1cf02f 100644 --- a/rash_core/src/modules/find.rs +++ b/rash_core/src/modules/find.rs @@ -55,19 +55,15 @@ use strum_macros::{Display, EnumString}; #[derive(Debug, PartialEq, Deserialize)] #[cfg_attr(feature = "docs", derive(EnumString, Display, JsonSchema))] #[serde(rename_all = "lowercase")] +#[derive(Default)] enum FileType { Any, Directory, + #[default] File, Link, } -impl Default for FileType { - fn default() -> Self { - FileType::File - } -} - fn default_file_type() -> Option { Some(FileType::default()) } @@ -206,7 +202,6 @@ fn find(params: Params) -> Result { .git_ignore(!params.hidden.unwrap()) .git_exclude(!params.hidden.unwrap()) .build() - .into_iter() .map(|dir_entry| dir_entry.map_err(|e| Error::new(ErrorKind::Other, e))) .collect::>>()? .into_iter()