mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 20:21:16 -03:00
clippy: fix ref_option lint
https://rust-lang.github.io/rust-clippy/master/index.html#ref_option Closes #12327
This commit is contained in:
committed by
Johannes Altmanninger
parent
16612c6e49
commit
2708191d3c
@@ -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.
|
||||
|
||||
@@ -249,7 +249,7 @@ fn read_interactive(
|
||||
prompt: &wstr,
|
||||
prompt_str_is_empty: bool,
|
||||
right_prompt: &wstr,
|
||||
commandline: &Option<WString>,
|
||||
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 &&
|
||||
|
||||
@@ -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<String, Vec<WString>>,
|
||||
opts: &Match<'args>,
|
||||
cg: &Option<Captures<'a>>,
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user