Skip to content

Commit

Permalink
Fix new v1.57 clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
th1000s authored and dandavison committed Dec 3, 2021
1 parent c8aa15d commit b38c0f0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ pub struct CommandLine {
pub fn calling_process() -> Option<Cow<'static, CallingProcess>> {
#[cfg(not(test))]
{
CACHED_CALLING_PROCESS
.as_ref()
.map(|proc| Cow::Borrowed(proc))
CACHED_CALLING_PROCESS.as_ref().map(Cow::Borrowed)
}
#[cfg(test)]
{
Expand Down Expand Up @@ -94,7 +92,7 @@ pub fn describe_calling_process(args: &[String]) -> ProcessArgs<CallingProcess>

match args.next() {
Some(command) => match Path::new(command).file_stem() {
Some(s) if s.to_str().map(|s| is_git_binary(s)).unwrap_or(false) => {
Some(s) if s.to_str().map(is_git_binary).unwrap_or(false) => {
let mut args = args.skip_while(|s| {
*s != "diff" && *s != "show" && *s != "log" && *s != "reflog" && *s != "grep"
});
Expand Down

0 comments on commit b38c0f0

Please sign in to comment.