Skip to content

Commit

Permalink
fix: Cargo clippy errors
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Gil <[email protected]>
  • Loading branch information
pando85 committed Aug 24, 2023
1 parent 9d33529 commit c30a3da
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
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
10 changes: 2 additions & 8 deletions rash_core/src/modules/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,17 @@ use serde_yaml::Value;
#[cfg(feature = "docs")]
use strum_macros::{Display, EnumString};

#[derive(Debug, PartialEq, Deserialize)]
#[derive(Debug, Default, PartialEq, Deserialize)]
#[cfg_attr(feature = "docs", derive(EnumString, Display, JsonSchema))]
#[serde(rename_all = "lowercase")]
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 +201,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

0 comments on commit c30a3da

Please sign in to comment.