rust: Automatically generated Clippy fixes for the tools only

Clippy settings:

[workspace.lints.clippy]
cognitive_complexity = "warn"
dbg_macro = "warn"
debug_assert_with_mut_call = "warn"
doc_link_with_quotes = "warn"
doc_markdown = "warn"
empty_line_after_outer_attr = "warn"
empty_structs_with_brackets = "warn"
float_cmp = "warn"
float_cmp_const = "warn"
float_equality_without_abs = "warn"
missing_const_for_fn = "warn"
missing_errors_doc = "warn"
mod_module_files = "warn"
option_if_let_else = "warn"
similar_names = "warn"
suspicious_operation_groupings = "warn"
unused_self = "warn"
use_debug = "warn"
used_underscore_binding = "warn"
useless_let_if_seq = "warn"
wildcard_dependencies = "warn"
wildcard_imports = "warn"

Command used:

  $ cargo +nightly clippy --fix

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2024-12-03 15:43:49 +01:00
committed by Jan Höppner
parent 3d83100fa3
commit b1ca60f5ba
6 changed files with 10 additions and 29 deletions
+2 -2
View File
@@ -86,14 +86,14 @@ pub struct HostKeyCheck<'a> {
}
impl<'a> HostKeyCheck<'a> {
pub fn new(check_enforced: bool, hash: Option<&'a Path>) -> Self {
pub const fn new(check_enforced: bool, hash: Option<&'a Path>) -> Self {
Self {
check_enforced,
hash,
}
}
pub fn hide(&self) -> bool {
pub const fn hide(&self) -> bool {
self.hash.is_none() && !self.check_enforced
}
}
+1 -1
View File
@@ -577,7 +577,7 @@ anyhow!(
///
/// # Error
/// Returns an error if the [`ExchangeFormatRequest`] contains no CUID,
pub fn config_uid(&self) -> &ConfigUid {
pub const fn config_uid(&self) -> &ConfigUid {
&self.config_uid
}
+1 -1
View File
@@ -14,7 +14,7 @@ use log::trace;
use std::process::ExitCode;
use utils::{print_cli_error, print_error, print_version, PvLogger};
use crate::cmd::*;
use crate::cmd::{check, create, perform, verify, CMD_FN, UV_CMD_FN};
static LOGGER: PvLogger = PvLogger;
const FEATURES: &[&[&str]] = &[CMD_FN, UV_CMD_FN];