diff options
author | Ben Armstead <benarmstead@protonmail.com> | 2021-08-18 18:59:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 11:59:02 -0700 |
commit | ea3417abe4d7ab6399254263ec42aae2fb986512 (patch) | |
tree | 5cb7e228deaa68da529f49f00d1d9a7149dbfc93 /src/parse.rs | |
parent | 2de7b51cc9bf6230149d7107b0f3fbdbc86b49bb (diff) |
Remove unnecessary borrows (#692)
Diffstat (limited to 'src/parse.rs')
-rw-r--r-- | src/parse.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parse.rs b/src/parse.rs index b39da14f..a62d486c 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -102,7 +102,7 @@ fn _parse_file_path(s: &str, git_diff_name: bool) -> String { match s.strip_suffix('\t').unwrap_or(s) { path if path == "/dev/null" => "/dev/null", path if git_diff_name && DIFF_PREFIXES.iter().any(|s| path.starts_with(s)) => &path[2..], - path if git_diff_name => &path, + path if git_diff_name => path, path => path.split('\t').next().unwrap_or(""), } .to_string() @@ -142,7 +142,7 @@ pub fn get_file_extension_from_file_meta_line_file_path(path: &str) -> Option<&s if path.is_empty() || path == "/dev/null" { None } else { - get_extension(&path).map(|ex| ex.trim()) + get_extension(path).map(|ex| ex.trim()) } } |