Address some clippy lints from nightly clippy

Note that in general we should not respect nightly clippy because it might
contradict stable clippy which is run in CI.
This commit is contained in:
Johannes Altmanninger
2023-10-03 06:34:55 -05:00
parent 10fed02572
commit 2fb352a9e4
4 changed files with 8 additions and 8 deletions

View File

@@ -21,7 +21,7 @@ pub fn random(
const longopts: &[woption] = &[wopt(L!("help"), woption_argument_t::no_argument, 'h')];
let mut w = wgetopter_t::new(shortopts, longopts, argv);
while let Some(c) = w.wgetopt_long() {
if let Some(c) = w.wgetopt_long() {
match c {
'h' => {
builtin_print_help(parser, streams, cmd);

View File

@@ -352,8 +352,8 @@ pub fn create(buffer_limit: usize, target: RawFd) -> Option<Rc<IoBufferfill>> {
}
}
// Our fillthread gets the read end of the pipe; out_pipe gets the write end.
let mut buffer = Arc::new(RwLock::new(IoBuffer::new(buffer_limit)));
begin_filling(&mut buffer, pipes.read);
let buffer = Arc::new(RwLock::new(IoBuffer::new(buffer_limit)));
begin_filling(&buffer, pipes.read);
assert!(pipes.write.is_valid(), "fd is not valid");
Some(Rc::new(IoBufferfill {
target,
@@ -511,7 +511,7 @@ pub fn fillthread_running(&self) -> bool {
}
/// Begin the fill operation, reading from the given fd in the background.
fn begin_filling(iobuffer: &mut Arc<RwLock<IoBuffer>>, fd: AutoCloseFd) {
fn begin_filling(iobuffer: &Arc<RwLock<IoBuffer>>, fd: AutoCloseFd) {
assert!(
!iobuffer.read().unwrap().fillthread_running(),
"Already have a fillthread"

View File

@@ -634,7 +634,7 @@ fn read_string(&mut self) -> Tok {
fn process_opening_quote(
this: &mut Tokenizer,
quoted_cmdsubs: &mut Vec<usize>,
paran_offsets: &mut Vec<usize>,
paran_offsets: &Vec<usize>,
quote: char,
) -> Result<(), usize> {
if let Some(end) = quote_end(&this.start, this.token_cursor, quote) {
@@ -705,7 +705,7 @@ fn process_opening_quote(
// The "$(" part of a quoted command substitution closes double quotes. To keep
// quotes balanced, act as if there was an invisible double quote after the ")".
if let Err(error_loc) =
process_opening_quote(self, &mut quoted_cmdsubs, &mut paran_offsets, '"')
process_opening_quote(self, &mut quoted_cmdsubs, &paran_offsets, '"')
{
if !self.accept_unfinished {
return self.call_error(
@@ -759,7 +759,7 @@ fn process_opening_quote(
mode &= !TOK_MODE_ARRAY_BRACKETS;
} else if c == '\'' || c == '"' {
if let Err(error_loc) =
process_opening_quote(self, &mut quoted_cmdsubs, &mut paran_offsets, c)
process_opening_quote(self, &mut quoted_cmdsubs, &paran_offsets, c)
{
if !self.accept_unfinished {
return self.call_error(

View File

@@ -852,7 +852,7 @@ fn expand_literal_intermediate_segment_with_fuzz(
// TODO: justify this, tests do not exercise it yet.
if m.rank() > c.r#match.rank() {
// Our match is fuzzier.
c.r#match = m.clone();
c.r#match = m;
}
}
}