Skip to content
Myr

Fix some clippy warnings

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Thayne McCombs · committed by David Peter · parent b29e87e · Browse files · 3 files+5 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+5 added−11 removed

  • other:+5 added−11 removed

3 files+5 added−11 removed

modified:src/exec/input.rs+2 added-2 removed
3 unmodified lines
4use crate::filesystem::strip_current_dir;56/// Removes the parent component of the path7pub fn basename(path: &Path) -> &OsStr {8 path.file_name().unwrap_or_else(|| path.as_os_str())8 path.file_name().unwrap_or(path.as_os_str())9}1011/// Removes the extension from the path12pub fn remove_extension(path: &Path) -> OsString {13 let dirname = dirname(path);14 let stem = path.file_stem().unwrap_or_else(|| path.as_os_str());14 let stem = path.file_stem().unwrap_or(path.as_os_str());1516 let path = PathBuf::from(dirname).join(stem);1718 strip_current_dir(&path).to_owned().into_os_string()
69 unmodified lines
modified:src/main.rs+1 added-1 removed
110 unmodified lines
111 ))112 }113}114115fn extract_search_pattern<'a>(matches: &'a clap::ArgMatches) -> Result<&'a str> {115fn extract_search_pattern(matches: &clap::ArgMatches) -> Result<&'_ str> {116 let pattern = matches117 .value_of_os("pattern")118 .map(|p| {119 p.to_str()
449 unmodified lines
modified:src/walk.rs+2 added-8 removed
102 unmodified lines
103 let result = walker.add_ignore(global_ignore_file);104 match result {105 Some(ignore::Error::Partial(_)) => (),106 Some(err) => {107 print_error(format!(108 "Malformed pattern in global ignore file. {}.",109 err.to_string()110 ));107 print_error(format!("Malformed pattern in global ignore file. {}.", err));108 }109 None => (),110 }111 }
3 unmodified lines
115 let result = walker.add_ignore(ignore_file);116 match result {117 Some(ignore::Error::Partial(_)) => (),118 Some(err) => {122 print_error(format!(123 "Malformed pattern in custom ignore file. {}.",124 err.to_string()125 ));119 print_error(format!("Malformed pattern in custom ignore file. {}.", err));120 }121 None => (),122 }123 }
502 unmodified lines