diff --git a/Cargo.lock b/Cargo.lock index b5eaf5a7..7e670b9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1399,9 +1399,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.165" +version = "0.2.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb4d3d38eab6c5239a362fa8bae48c03baf980a6e7079f063942d563ef3533e" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" [[package]] name = "libfuzzer-sys" diff --git a/brush-core/src/completion.rs b/brush-core/src/completion.rs index 5a73cee8..f15b3280 100644 --- a/brush-core/src/completion.rs +++ b/brush-core/src/completion.rs @@ -891,11 +891,7 @@ impl Config { simple_tokenize_by_delimiters(input, &default_delimiters) } - async fn get_completions_for_token<'a>( - &self, - shell: &mut Shell, - context: Context<'a>, - ) -> Answer { + async fn get_completions_for_token(&self, shell: &mut Shell, context: Context<'_>) -> Answer { // See if we can find a completion spec matching the current command. let mut found_spec: Option<&Spec> = None; diff --git a/brush-core/src/expansion.rs b/brush-core/src/expansion.rs index 7263b594..c081c609 100644 --- a/brush-core/src/expansion.rs +++ b/brush-core/src/expansion.rs @@ -343,6 +343,7 @@ impl<'a> WordExpander<'a> { Ok(expanded) } + #[allow(clippy::ref_option)] async fn basic_expand_opt_pattern( &mut self, word: &Option, @@ -1337,6 +1338,7 @@ impl<'a> WordExpander<'a> { } #[allow(clippy::unwrap_in_result)] + #[allow(clippy::ref_option)] fn uppercase_first_char( s: String, pattern: &Option, @@ -1362,6 +1364,7 @@ impl<'a> WordExpander<'a> { } #[allow(clippy::unwrap_in_result)] + #[allow(clippy::ref_option)] fn lowercase_first_char( s: String, pattern: &Option, @@ -1386,6 +1389,7 @@ impl<'a> WordExpander<'a> { } } + #[allow(clippy::ref_option)] fn uppercase_pattern( s: &str, pattern: &Option, @@ -1405,6 +1409,7 @@ impl<'a> WordExpander<'a> { } } + #[allow(clippy::ref_option)] fn lowercase_pattern( s: &str, pattern: &Option, diff --git a/brush-core/src/interp.rs b/brush-core/src/interp.rs index cc057d0c..64d6c83e 100644 --- a/brush-core/src/interp.rs +++ b/brush-core/src/interp.rs @@ -1259,8 +1259,8 @@ fn setup_pipeline_redirection( } #[allow(clippy::too_many_lines)] -pub(crate) async fn setup_redirect<'a>( - open_files: &'a mut OpenFiles, +pub(crate) async fn setup_redirect( + open_files: &'_ mut OpenFiles, shell: &mut Shell, redirect: &ast::IoRedirect, ) -> Result, error::Error> { diff --git a/brush-core/src/patterns.rs b/brush-core/src/patterns.rs index 6b6f63fe..c636cfba 100644 --- a/brush-core/src/patterns.rs +++ b/brush-core/src/patterns.rs @@ -394,6 +394,7 @@ fn pattern_to_regex_str( /// * `s` - The string to remove the prefix from. /// * `pattern` - The pattern to match. /// * `enable_extended_globbing` - Whether or not to enable extended globbing (extglob). +#[allow(clippy::ref_option)] pub(crate) fn remove_largest_matching_prefix<'a>( s: &'a str, pattern: &Option, @@ -416,6 +417,7 @@ pub(crate) fn remove_largest_matching_prefix<'a>( /// * `s` - The string to remove the prefix from. /// * `pattern` - The pattern to match. /// * `enable_extended_globbing` - Whether or not to enable extended globbing (extglob). +#[allow(clippy::ref_option)] pub(crate) fn remove_smallest_matching_prefix<'a>( s: &'a str, pattern: &Option, @@ -438,6 +440,7 @@ pub(crate) fn remove_smallest_matching_prefix<'a>( /// * `s` - The string to remove the suffix from. /// * `pattern` - The pattern to match. /// * `enable_extended_globbing` - Whether or not to enable extended globbing (extglob). +#[allow(clippy::ref_option)] pub(crate) fn remove_largest_matching_suffix<'a>( s: &'a str, pattern: &Option, @@ -460,6 +463,7 @@ pub(crate) fn remove_largest_matching_suffix<'a>( /// * `s` - The string to remove the suffix from. /// * `pattern` - The pattern to match. /// * `enable_extended_globbing` - Whether or not to enable extended globbing (extglob). +#[allow(clippy::ref_option)] pub(crate) fn remove_smallest_matching_suffix<'a>( s: &'a str, pattern: &Option, diff --git a/brush-interactive/src/reedline/refs.rs b/brush-interactive/src/reedline/refs.rs index d66bf903..a142e26a 100644 --- a/brush-interactive/src/reedline/refs.rs +++ b/brush-interactive/src/reedline/refs.rs @@ -11,7 +11,7 @@ pub(crate) struct ReedlineShellReader<'a> { pub shell: MutexGuard<'a, brush_core::Shell>, } -impl<'a> AsRef for ReedlineShellReader<'a> { +impl AsRef for ReedlineShellReader<'_> { fn as_ref(&self) -> &brush_core::Shell { self.shell.borrow() } @@ -21,7 +21,7 @@ pub(crate) struct ReedlineShellWriter<'a> { pub shell: MutexGuard<'a, brush_core::Shell>, } -impl<'a> AsMut for ReedlineShellWriter<'a> { +impl AsMut for ReedlineShellWriter<'_> { fn as_mut(&mut self) -> &mut brush_core::Shell { self.shell.borrow_mut() } diff --git a/brush-parser/src/parser.rs b/brush-parser/src/parser.rs index 9d083d51..1d1c9af5 100644 --- a/brush-parser/src/parser.rs +++ b/brush-parser/src/parser.rs @@ -130,7 +130,7 @@ pub fn parse_tokens( result } -impl<'a> peg::Parse for Tokens<'a> { +impl peg::Parse for Tokens<'_> { type PositionRepr = usize; #[inline] diff --git a/brush-parser/src/tokenizer.rs b/brush-parser/src/tokenizer.rs index 6646a144..02b3136f 100644 --- a/brush-parser/src/tokenizer.rs +++ b/brush-parser/src/tokenizer.rs @@ -1139,7 +1139,7 @@ impl<'a, R: ?Sized + std::io::BufRead> Tokenizer<'a, R> { } } -impl<'a, R: ?Sized + std::io::BufRead> Iterator for Tokenizer<'a, R> { +impl Iterator for Tokenizer<'_, R> { type Item = Result; fn next(&mut self) -> Option {