From 5d29e0536d6bc4b4125fca9181b58c9b063a3e23 Mon Sep 17 00:00:00 2001 From: Peter Grayson Date: Sun, 8 Sep 2024 17:02:32 -0400 Subject: [PATCH] refactor: clippy lints --- src/cmd/completion/man.rs | 2 +- src/main.rs | 2 +- src/wrap/partialrefname.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/completion/man.rs b/src/cmd/completion/man.rs index 64733390..ba5f944c 100644 --- a/src/cmd/completion/man.rs +++ b/src/cmd/completion/man.rs @@ -389,7 +389,7 @@ fn add_options( fn make_links(text: &str) -> String { let mut output = String::new(); - let mut words = text.split_inclusive(|c| c == ' ' || c == '\n'); + let mut words = text.split_inclusive([' ', '\n']); while let Some(word) = words.next() { if let Some(remainder) = word.strip_prefix("git-") { diff --git a/src/main.rs b/src/main.rs index cc979d8c..49f79352 100644 --- a/src/main.rs +++ b/src/main.rs @@ -379,7 +379,7 @@ fn execute_shell_alias( if user_args.is_empty() { command.arg(&alias.command); } else { - command.arg(&format!("{} \"$@\"", &alias.command)); + command.arg(format!("{} \"$@\"", &alias.command)); command.arg(&alias.command); } command diff --git a/src/wrap/partialrefname.rs b/src/wrap/partialrefname.rs index c6374915..6f069054 100644 --- a/src/wrap/partialrefname.rs +++ b/src/wrap/partialrefname.rs @@ -95,7 +95,7 @@ pub(crate) fn partial_ref_name(input: &mut &str) -> PResult { input.next_token(); split_offset -= 1; } - if input[..split_offset].ends_with(|c| matches!(c, '.' | '/')) { + if input[..split_offset].ends_with(['.', '/']) { split_offset -= 1; }