Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Upgrade to Rust 1.70 and fix new clippy warnings #310

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [
[workspace.package]
version = "1.8.6"
authors = ["Pando85 <[email protected]>"]
rust-version = "1.67"
rust-version = "1.70"
edition = "2021"
license-file = "LICENSE"
homepage = "https://rash.sh"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 [email protected]

Expand Down
1 change: 0 additions & 1 deletion rash_core/src/docopt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ pub fn parse(file: &str, args: &[&str]) -> Result<Vars> {
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))
Expand Down
1 change: 0 additions & 1 deletion rash_core/src/docopt/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ impl Options {
pub fn parse_doc(doc: &str, usages: &[String]) -> Result<Self> {
let mut description_options = Options::new(
doc.split('\n')
.into_iter()
.filter_map(|line| {
let trimmed = line.trim_start();
if trimmed.starts_with('-') {
Expand Down
9 changes: 2 additions & 7 deletions rash_core/src/modules/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FileType> {
Some(FileType::default())
}
Expand Down Expand Up @@ -206,7 +202,6 @@ fn find(params: Params) -> Result<ModuleResult> {
.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::<Result<Vec<_>>>()?
.into_iter()
Expand Down