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

View File

@@ -135,10 +135,7 @@ fn main() -> anyhowRes<()> {
/* ---- GET INFORMATION ---- */
// get stfle bits
let stfle_bits = match Stfle::new() {
Ok(stfle) => stfle,
Err(e) => return Err(e),
};
let stfle_bits = Stfle::new()?;
// check stfle bits for available MSA levels
for lvl in &mut levels {

View File

@@ -5,7 +5,6 @@
use std::fs::File;
use std::io::Error;
use std::io::Read;
use std::io::Result as ioRes;
use std::ops::Index;
use std::result::Result;
@@ -217,10 +216,7 @@ pub fn query(ins: &InstructionKind, fc: u8) -> Result<Param, Error> {
);
// open file
let mut f = match File::open(filepath) {
ioRes::Ok(file) => file,
Err(e) => return Err(e),
};
let mut f = File::open(filepath)?;
// read file
let res = match param {
@@ -228,10 +224,7 @@ pub fn query(ins: &InstructionKind, fc: u8) -> Result<Param, Error> {
Param::QaiParam(ref mut c) => read_file_to_buf(&mut f, c),
};
let bytes_read = match res {
Ok(b) => b,
Err(e) => return Err(e),
};
let bytes_read = res?;
match bytes_read == bytes_to_be_read {
true => Ok(param),