diff --git a/Cargo.toml b/Cargo.toml index 999387de0..d834d5d87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -201,6 +201,7 @@ needless_lifetimes = "allow" new_without_default = "allow" option_map_unit_fn = "allow" ptr_offset_by_literal = "warn" +ref_option = "warn" # We do not want to use the e?print(ln)?! macros. # These lints flag their use. diff --git a/src/builtins/read.rs b/src/builtins/read.rs index 24b6c6191..dc9ab8851 100644 --- a/src/builtins/read.rs +++ b/src/builtins/read.rs @@ -249,7 +249,7 @@ fn read_interactive( prompt: &wstr, prompt_str_is_empty: bool, right_prompt: &wstr, - commandline: &Option, + commandline: Option<&WString>, inputfd: RawFd, ) -> BuiltinResult { let mut exit_res = Ok(SUCCESS); @@ -647,7 +647,7 @@ pub fn read(parser: &Parser, streams: &mut IoStreams, argv: &mut [&wstr]) -> Bui opts.prompt.as_ref().unwrap(), opts.prompt_str.as_ref().is_some_and(|ps| ps.is_empty()), &opts.right_prompt, - &opts.commandline, + opts.commandline.as_ref(), streams.stdin_fd(), ); } else if opts.nchars.is_none() && !stream_stdin_is_a_tty && diff --git a/src/builtins/string/match.rs b/src/builtins/string/match.rs index 5a2e3149f..b62ebed1a 100644 --- a/src/builtins/string/match.rs +++ b/src/builtins/string/match.rs @@ -260,7 +260,7 @@ fn report_matches(&mut self, arg: &wstr, streams: &mut IoStreams) -> Result<(), Self::populate_captures_from_match( &mut self.first_match_captures, self.opts, - actual, + actual.as_ref(), ); } } @@ -274,7 +274,7 @@ fn report_matches(&mut self, arg: &wstr, streams: &mut IoStreams) -> Result<(), Self::populate_captures_from_match( &mut self.first_match_captures, self.opts, - &cg, + cg.as_ref(), ); } } @@ -285,7 +285,7 @@ fn report_matches(&mut self, arg: &wstr, streams: &mut IoStreams) -> Result<(), fn populate_captures_from_match<'a>( first_match_captures: &mut HashMap>, opts: &Match<'args>, - cg: &Option>, + cg: Option<&Captures<'a>>, ) { for (name, captures) in first_match_captures.iter_mut() { // If there are multiple named groups and --all was used, we need to ensure that