Address some clippy lints

I got these with clippy 1.67 but not with 1.73 (possible regression?).
This commit is contained in:
Johannes Altmanninger 2023-12-06 18:45:51 +01:00
parent d7a6c7f66a
commit b361d1a0cf
3 changed files with 7 additions and 7 deletions

View File

@ -311,7 +311,7 @@ pub fn copy(name: &wstr, new_name: WString, parser: &Parser) -> bool {
let mut new_props = props.as_ref().clone(); let mut new_props = props.as_ref().clone();
new_props.is_autoload.store(false); new_props.is_autoload.store(false);
new_props.is_copy = true; new_props.is_copy = true;
new_props.copy_definition_file = filename.clone(); new_props.copy_definition_file = filename;
new_props.copy_definition_lineno = lineno.unwrap_or(0) as i32; new_props.copy_definition_lineno = lineno.unwrap_or(0) as i32;
// Note this will NOT overwrite an existing function with the new name. // Note this will NOT overwrite an existing function with the new name.

View File

@ -878,7 +878,7 @@ impl<'a> ParseExecutionContext {
let reason = self.determine_redirections(ctx, args_or_redirs, &mut redirections); let reason = self.determine_redirections(ctx, args_or_redirs, &mut redirections);
if reason == EndExecutionReason::ok { if reason == EndExecutionReason::ok {
proc.typ = ProcessType::block_node; proc.typ = ProcessType::block_node;
proc.block_node_source = Some(self.pstree().clone()); proc.block_node_source = Some(self.pstree());
proc.internal_block_node = Some(statement.into()); proc.internal_block_node = Some(statement.into());
proc.set_redirection_specs(redirections); proc.set_redirection_specs(redirections);
} }
@ -1633,7 +1633,7 @@ impl<'a> ParseExecutionContext {
if props.wants_timing && props.initial_background { if props.wants_timing && props.initial_background {
return report_error!( return report_error!(
self, self,
&ctx, ctx,
STATUS_INVALID_ARGS.unwrap(), STATUS_INVALID_ARGS.unwrap(),
job_node, job_node,
ERROR_TIME_BACKGROUND ERROR_TIME_BACKGROUND

View File

@ -60,11 +60,11 @@ pub enum WildcardResult {
} }
// This does something horrible refactored from an even more horrible function. // This does something horrible refactored from an even more horrible function.
fn resolve_description<'f>( fn resolve_description(
full_completion: &wstr, full_completion: &wstr,
completion: &mut &wstr, completion: &mut &wstr,
expand_flags: ExpandFlags, expand_flags: ExpandFlags,
description_func: Option<&'f dyn Fn(&wstr) -> WString>, description_func: Option<&dyn Fn(&wstr) -> WString>,
) -> WString { ) -> WString {
if let Some(complete_sep_loc) = completion.find_char(PROG_COMPLETE_SEP) { if let Some(complete_sep_loc) = completion.find_char(PROG_COMPLETE_SEP) {
// This completion has an embedded description, do not use the generic description. // This completion has an embedded description, do not use the generic description.
@ -283,10 +283,10 @@ fn wildcard_complete_internal(
} }
} }
pub fn wildcard_complete<'f>( pub fn wildcard_complete(
s: &wstr, s: &wstr,
wc: &wstr, wc: &wstr,
desc_func: Option<&'f dyn Fn(&wstr) -> WString>, desc_func: Option<&dyn Fn(&wstr) -> WString>,
out: Option<&mut CompletionReceiver>, out: Option<&mut CompletionReceiver>,
expand_flags: ExpandFlags, expand_flags: ExpandFlags,
flags: CompleteFlags, flags: CompleteFlags,