Error: SHELLCHECK_WARNING (CWE-457): [#def1] /usr/lib/dracut/modules.d/51bootc/module-setup.sh:16:18: warning[SC2154]: systemdsystemunitdir is referenced but not assigned. # 14| local service=bootc-root-setup.service # 15| dracut_install /usr/lib/bootc/initramfs-setup # 16|-> inst_simple "${systemdsystemunitdir}/${service}" # 17| mkdir -p "${initdir}${systemdsystemconfdir}/initrd-root-fs.target.wants" # 18| ln_r "${systemdsystemunitdir}/${service}" \ Error: SHELLCHECK_WARNING (CWE-457): [#def2] /usr/lib/dracut/modules.d/51bootc/module-setup.sh:17:15: warning[SC2154]: initdir is referenced but not assigned. # 15| dracut_install /usr/lib/bootc/initramfs-setup # 16| inst_simple "${systemdsystemunitdir}/${service}" # 17|-> mkdir -p "${initdir}${systemdsystemconfdir}/initrd-root-fs.target.wants" # 18| ln_r "${systemdsystemunitdir}/${service}" \ # 19| "${systemdsystemconfdir}/initrd-root-fs.target.wants/${service}" Error: SHELLCHECK_WARNING (CWE-457): [#def3] /usr/lib/dracut/modules.d/51bootc/module-setup.sh:17:25: warning[SC2154]: systemdsystemconfdir is referenced but not assigned. # 15| dracut_install /usr/lib/bootc/initramfs-setup # 16| inst_simple "${systemdsystemunitdir}/${service}" # 17|-> mkdir -p "${initdir}${systemdsystemconfdir}/initrd-root-fs.target.wants" # 18| ln_r "${systemdsystemunitdir}/${service}" \ # 19| "${systemdsystemconfdir}/initrd-root-fs.target.wants/${service}" Error: COMPILER_WARNING (CWE-704): [#def4] bootc-202603201912.ga2edd7c979/vendor/libz-sys/src/smoke.c: scope_hint: In function 'main' bootc-202603201912.ga2edd7c979/vendor/libz-sys/src/smoke.c:4:10: warning[-Wpointer-to-int-cast]: cast from pointer to integer of different size # 2| # 3| int main() { # 4|-> return (int) adler32; # 5| } Error: CLIPPY_WARNING: [#def5] crates/blockdev/src/blockdev.rs:109:9: warning: this `if` statement can be collapsed # | # 109 | / if self.is_mpath()? { # 110 | | if let Some(partn) = esp_device.partn { # 111 | | return Ok(partn.to_string()); # 112 | | } # 113 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # = note: `#[warn(clippy::collapsible_if)]` on by default # help: collapse nested if block # | # 109 ~ if self.is_mpath()? # 110 ~ && let Some(partn) = esp_device.partn { # 111 | return Ok(partn.to_string()); # 112 ~ } # | Error: CLIPPY_WARNING: [#def6] crates/etc-merge/src/lib.rs:79:5: warning: unneeded `return` statement # | # 79 | return true; # | ^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # = note: `#[warn(clippy::needless_return)]` on by default # help: remove `return` # | # 79 - return true; # 79 + true # | Error: CLIPPY_WARNING: [#def7] crates/etc-merge/src/lib.rs:311:5: warning: doc list item without indentation # | # 311 | /// Usually this will be obtained by remounting the EROFS image to a temporary location # | ^ # | # = help: if this is supposed to be its own paragraph, add a blank line # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#doc_lazy_continuation # = note: `#[warn(clippy::doc_lazy_continuation)]` on by default # help: indent this line # | # 311 | /// Usually this will be obtained by remounting the EROFS image to a temporary location # | ++ Error: CLIPPY_WARNING: [#def8] crates/etc-merge/src/lib.rs:316:5: warning: doc list item without indentation # | # 316 | /// again be usually obtained by mounting the new EROFS image to a temporary location. If merging # | ^ # | # = help: if this is supposed to be its own paragraph, add a blank line # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#doc_lazy_continuation # help: indent this line # | # 316 | /// again be usually obtained by mounting the new EROFS image to a temporary location. If merging # | ++ Error: CLIPPY_WARNING: [#def9] crates/etc-merge/src/lib.rs:317:5: warning: doc list item without indentation # | # 317 | /// it will be necessary to make the `/etc` for the deployment writeable # | ^ # | # = help: if this is supposed to be its own paragraph, add a blank line # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#doc_lazy_continuation # help: indent this line # | # 317 | /// it will be necessary to make the `/etc` for the deployment writeable # | ++ Error: CLIPPY_WARNING: [#def10] crates/etc-merge/src/lib.rs:330:6: warning: very complex type used. Consider factoring parts into `type` definitions # | # 330 | ) -> anyhow::Result<( # | ______^ # 331 | | Directory<CustomMetadata>, # 332 | | Directory<CustomMetadata>, # 333 | | Option<Directory<CustomMetadata>>, # 334 | | )> { # | |__^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#type_complexity # = note: `#[warn(clippy::type_complexity)]` on by default Error: CLIPPY_WARNING: [#def11] crates/etc-merge/src/lib.rs:354:5: warning: unneeded `return` statement # | # 354 | return Ok((pristine_etc_files, current_etc_files, new_etc_files)); # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # help: remove `return` # | # 354 - return Ok((pristine_etc_files, current_etc_files, new_etc_files)); # 354 + Ok((pristine_etc_files, current_etc_files, new_etc_files)) # | Error: CLIPPY_WARNING: [#def12] crates/etc-merge/src/lib.rs:459:35: warning: useless use of `format!` # | # 459 | let entry = entry.context(format!("Getting entry"))?; # | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Getting entry".to_string()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#useless_format # = note: `#[warn(clippy::useless_format)]` on by default Error: CLIPPY_WARNING: [#def13] crates/initramfs/src/lib.rs:216:9: warning: this `if` statement can be collapsed # | # 216 | / if let Some(label) = base_dir.getxattr(".", "security.selinux")? { # 217 | | if let Ok(cstr) = CString::new(label) { # 218 | | fsconfig_set_string(tmpfs.as_fd(), "rootcontext", &cstr)?; # 219 | | } # 220 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # = note: `#[warn(clippy::collapsible_if)]` on by default # help: collapse nested if block # | # 216 ~ if let Some(label) = base_dir.getxattr(".", "security.selinux")? # 217 ~ && let Ok(cstr) = CString::new(label) { # 218 | fsconfig_set_string(tmpfs.as_fd(), "rootcontext", &cstr)?; # 219 ~ } # | Error: CLIPPY_WARNING: [#def14] crates/kernel_cmdline/src/utf8.rs:371:9: warning: this `if` statement can be collapsed # | # 371 | / if let Some(value) = bytes.value() { # 372 | | if str::from_utf8(value).is_err() { # 373 | | anyhow::bail!("Parameter value is not valid UTF-8"); # 374 | | } # 375 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # = note: `#[warn(clippy::collapsible_if)]` on by default # help: collapse nested if block # | # 371 ~ if let Some(value) = bytes.value() # 372 ~ && str::from_utf8(value).is_err() { # 373 | anyhow::bail!("Parameter value is not valid UTF-8"); # 374 ~ } # | Error: CLIPPY_WARNING: [#def15] crates/lib/src/bootc_composefs/boot.rs:454:6: warning: very complex type used. Consider factoring parts into `type` definitions # | # 454 | ) -> Result<Option<(String, Option<String>, Option<String>)>> { # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#type_complexity # = note: `#[warn(clippy::type_complexity)]` on by default Error: CLIPPY_WARNING: [#def16] crates/lib/src/bootc_composefs/boot.rs:560:21: warning: useless conversion to the same type: `bootc_kernel_cmdline::utf8::Cmdline<'_>` # | # 560 | Cmdline::from(options) # | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Cmdline::from()`: `options` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#useless_conversion # = note: `#[warn(clippy::useless_conversion)]` on by default Error: CLIPPY_WARNING: [#def17] crates/lib/src/bootc_composefs/boot.rs:922:29: warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator # | # 922 | PEType::UkiAddon => file_path # | _____________________________^ # 923 | | .components() # 924 | | .last() # | |______________-----^ # | | # | help: try: `next_back()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#double_ended_iterator_last # = note: `#[warn(clippy::double_ended_iterator_last)]` on by default Error: CLIPPY_WARNING: [#def18] crates/lib/src/bootc_composefs/boot.rs:1156:38: warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator # | # 1156 | let addon_name = entry # | ______________________________________^ # 1157 | | .file_path # 1158 | | .components() # 1159 | | .last() # | |__________________________-----^ # | | # | help: try: `next_back()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#double_ended_iterator_last Error: CLIPPY_WARNING: [#def19] crates/lib/src/bootc_composefs/boot.rs:1252:5: warning: unneeded `return` statement # | # 1252 | / return Ok(Some(SecurebootKeys { # 1253 | | dir: keys_dir, # 1254 | | keys: entries, # 1255 | | })); # | |_______^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # = note: `#[warn(clippy::needless_return)]` on by default # help: remove `return` # | # 1252 ~ Ok(Some(SecurebootKeys { # 1253 + dir: keys_dir, # 1254 + keys: entries, # 1255 ~ })) # | Error: CLIPPY_WARNING: [#def20] crates/lib/src/bootc_composefs/boot.rs:1317:23: warning: using `.iter().next()` on an array # | # 1317 | let Some(entry) = entries.iter().next() else { # | ^^^^^^^^^^^^^^^^^^^^^ help: try calling: `entries.first()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#iter_next_slice # = note: `#[warn(clippy::iter_next_slice)]` on by default Error: CLIPPY_WARNING: [#def21] crates/lib/src/bootc_composefs/delete.rs:240:8: warning: taken reference of right operand # | # 240 | if deployment_id == &booted.verity { # | ^^^^^^^^^^^^^^^^^-------------- # | | # | help: use the right value directly: `booted.verity` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#op_ref # = note: `#[warn(clippy::op_ref)]` on by default Error: CLIPPY_WARNING: [#def22] crates/lib/src/bootc_composefs/delete.rs:254:27: warning: this `map_or` can be simplified # | # 254 | let deleting_staged = host # | ___________________________^ # 255 | | .status # 256 | | .staged # 257 | | .as_ref() # 258 | | .and_then(|s| s.composefs.as_ref()) # 259 | | .map_or(false, |cfs| cfs.verity == deployment_id); # | |_________________________________________________________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unnecessary_map_or # = note: `#[warn(clippy::unnecessary_map_or)]` on by default # help: use is_some_and instead # | # 259 - .map_or(false, |cfs| cfs.verity == deployment_id); # 259 + .is_some_and(|cfs| cfs.verity == deployment_id); # | Error: CLIPPY_WARNING: [#def23] crates/lib/src/bootc_composefs/export.rs:164:36: warning: using `clone` on type `Option<&History>` which implements the `Copy` trait # | # 164 | let previous_description = history_entry # | ____________________________________^ # 165 | | .clone() # | |____________________^ help: try removing the `clone` call: `history_entry` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#clone_on_copy # = note: `#[warn(clippy::clone_on_copy)]` on by default Error: CLIPPY_WARNING: [#def24] crates/lib/src/bootc_composefs/gc.rs:236:14: warning: using `contains()` instead of `iter().any()` is more efficient # | # 236 | !bootloader_entries # | ______________^ # 237 | | .iter() # 238 | | .any(|boot_entry| bin_path.1 == *boot_entry) # | |____________________________________________________________^ help: try: `bootloader_entries.contains(&bin_path.1)` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#manual_contains # = note: `#[warn(clippy::manual_contains)]` on by default Error: CLIPPY_WARNING: [#def25] crates/lib/src/bootc_composefs/state.rs:132:5: warning: returning the result of a `let` binding from a block # | # 123 | / let cp_ret = Command::new("cp") # 124 | | .args([ # 125 | | "-a", # 126 | | "--remove-destination", # ... | # 129 | | ]) # 130 | | .run_capture_stderr(); # | |______________________________- unnecessary `let` binding # 131 | # 132 | cp_ret # | ^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#let_and_return # = note: `#[warn(clippy::let_and_return)]` on by default # help: return the expression directly # | # 123 ~ # 124 | # 125 ~ Command::new("cp") # 126 + .args([ # 127 + "-a", # 128 + "--remove-destination", # 129 + &format!("{}/etc/.", tempdir.dir.path().as_str()?), # 130 + &format!("{state_path}/etc/."), # 131 + ]) # 132 + .run_capture_stderr() # | Error: CLIPPY_WARNING: [#def26] crates/lib/src/bootc_composefs/state.rs:238:1: warning: this function has too many arguments (8/7) # | # 238 | / pub(crate) async fn write_composefs_state( # 239 | | root_path: &Utf8PathBuf, # 240 | | deployment_id: &Sha512HashValue, # 241 | | target_imgref: &ImageReference, # ... | # 246 | | allow_missing_fsverity: bool, # 247 | | ) -> Result<()> { # | |_______________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#too_many_arguments # = note: `#[warn(clippy::too_many_arguments)]` on by default Error: CLIPPY_WARNING: [#def27] crates/lib/src/bootc_composefs/status.rs:331:19: warning: slow zero-filling initialization # | # 331 | let mut buf = Vec::with_capacity(manifest.config().size() as usize); # | ___________________^ # 332 | | buf.resize(manifest.config().size() as usize, 0); # | |____________________________________________________^ help: consider replacing this with: `vec![0; manifest.config().size() as usize]` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#slow_vector_initialization # = note: `#[warn(clippy::slow_vector_initialization)]` on by default Error: CLIPPY_WARNING: [#def28] crates/lib/src/bootc_composefs/status.rs:544:5: warning: unneeded `return` statement # | # 544 | return true; # | ^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # help: remove `return` # | # 544 - return true; # 544 + true # | Error: CLIPPY_WARNING: [#def29] crates/lib/src/bootc_composefs/status.rs:562:43: warning: deref which would be done by auto-deref # | # 562 | let booted_bls_entry = find_bls_entry(&*booted_cmdline.digest, &bls_entries)? # | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&booted_cmdline.digest` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#explicit_auto_deref # = note: `#[warn(clippy::explicit_auto_deref)]` on by default Error: CLIPPY_WARNING: [#def30] crates/lib/src/bootc_composefs/status.rs:620:8: warning: needless call to `as_bytes` # | # 620 | if target.full_cmdline.as_bytes().len() != booted.full_cmdline.as_bytes().len() { # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `target.full_cmdline.len()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_as_bytes # = note: `#[warn(clippy::needless_as_bytes)]` on by default Error: CLIPPY_WARNING: [#def31] crates/lib/src/bootc_composefs/status.rs:620:48: warning: needless call to `as_bytes` # | # 620 | if target.full_cmdline.as_bytes().len() != booted.full_cmdline.as_bytes().len() { # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `booted.full_cmdline.len()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_as_bytes Error: CLIPPY_WARNING: [#def32] crates/lib/src/bootc_composefs/status.rs:631:5: warning: unneeded `return` statement # | # 631 | return Ok(cmdline_eq && selinux_compatible); # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # help: remove `return` # | # 631 - return Ok(cmdline_eq && selinux_compatible); # 631 + Ok(cmdline_eq && selinux_compatible) # | Error: CLIPPY_WARNING: [#def33] crates/lib/src/bootc_composefs/update.rs:105:5: warning: doc list item overindented # | # 105 | /// /run/composefs/staged-deployment which is the last thing we create while upgrading # | ^^^ help: try using ` ` (2 spaces) # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#doc_overindented_list_items # = note: `#[warn(clippy::doc_overindented_list_items)]` on by default Error: CLIPPY_WARNING: [#def34] crates/lib/src/bootc_composefs/update.rs:110:5: warning: doc list item overindented # | # 110 | /// point # | ^^^ help: try using ` ` (2 spaces) # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#doc_overindented_list_items Error: CLIPPY_WARNING: [#def35] crates/lib/src/bootc_composefs/update.rs:115:5: warning: doc list item overindented # | # 115 | /// was created, or at any other point in time, or it's a new one. # | ^^^ help: try using ` ` (2 spaces) # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#doc_overindented_list_items Error: CLIPPY_WARNING: [#def36] crates/lib/src/bootc_composefs/update.rs:116:5: warning: doc list item overindented # | # 116 | /// Any which way, we can overwrite everything # | ^^^ help: try using ` ` (2 spaces) # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#doc_overindented_list_items Error: CLIPPY_WARNING: [#def37] crates/lib/src/bootc_composefs/update.rs:225:14: warning: writing `&String` instead of `&str` involves a new object where a slice will do # | # 225 | depl_id: &String, # | ^^^^^^^ help: change this to: `&str` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#ptr_arg # = note: `#[warn(clippy::ptr_arg)]` on by default Error: CLIPPY_WARNING: [#def38] crates/lib/src/bootc_composefs/update.rs:265:23: warning: using `.iter().next()` on an array # | # 265 | let Some(entry) = entries.iter().next() else { # | ^^^^^^^^^^^^^^^^^^^^^ help: try calling: `entries.first()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#iter_next_slice Error: CLIPPY_WARNING: [#def39] crates/lib/src/bootc_composefs/update.rs:495:34: warning: deref which would be done by auto-deref # | # 495 | get_imginfo(storage, &*composefs.cmdline.digest, Some(booted_imgref)).await?; # | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&composefs.cmdline.digest` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#explicit_auto_deref Error: CLIPPY_WARNING: [#def40] crates/lib/src/cli.rs:1233:5: warning: unneeded `return` statement # | # 1233 | return Ok(target); # | ^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # help: remove `return` # | # 1233 - return Ok(target); # 1233 + Ok(target) # | Error: CLIPPY_WARNING: [#def41] crates/lib/src/container_export.rs:246:1: warning: this function has too many arguments (8/7) # | # 246 | / fn add_file_to_tar_from_walk<W: Write>( # 247 | | tar_builder: &mut tar::Builder<W>, # 248 | | dir: &cap_std_ext::cap_std::fs::Dir, # 249 | | filename: &std::ffi::OsStr, # ... | # 254 | | hardlinks: &mut HashMap<u64, std::path::PathBuf>, # 255 | | ) -> Result<()> { # | |_______________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#too_many_arguments Error: CLIPPY_WARNING: [#def42] crates/lib/src/deploy.rs:383:23: warning: manual saturating arithmetic # | # 383 | let bytes_avail = stat.f_bsize.checked_mul(stat.f_bavail).unwrap_or(u64::MAX); # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_mul`: `stat.f_bsize.saturating_mul(stat.f_bavail)` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#manual_saturating_arithmetic # = note: `#[warn(clippy::manual_saturating_arithmetic)]` on by default Error: CLIPPY_WARNING: [#def43] crates/lib/src/deploy.rs:862:13: warning: field assignment outside of initializer for an instance created with Default::default() # | # 862 | opts.locked = lock_finalization; # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | # note: consider initializing the variable with `SysrootDeployTreeOpts::<'_> { locked: lock_finalization, ..Default::default() }` and removing relevant reassignments # --> crates/lib/src/deploy.rs:859:13 # | # 859 | let mut opts = ostree::SysrootDeployTreeOpts::default(); # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#field_reassign_with_default # = note: `#[warn(clippy::field_reassign_with_default)]` on by default Error: CLIPPY_WARNING: [#def44] crates/lib/src/image.rs:188:5: warning: unneeded `return` statement # | # 188 | return Ok((src_imgref, dest_imgref)); # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # help: remove `return` # | # 188 - return Ok((src_imgref, dest_imgref)); # 188 + Ok((src_imgref, dest_imgref)) # | Error: CLIPPY_WARNING: [#def45] crates/lib/src/install.rs:1659:5: warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` # | # 1659 | / match kernel { # 1660 | | Some(k) => match k.k_type { # 1661 | | crate::kernel::KernelType::Uki { cmdline, .. } => { # 1662 | | let allow_missing_fsverity = cmdline.is_some_and(|cmd| { # ... | # 1681 | | None => {} # 1682 | | } # | |_____^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#single_match # = note: `#[warn(clippy::single_match)]` on by default # help: try # | # 1659 ~ if let Some(k) = kernel { match k.k_type { # 1660 + crate::kernel::KernelType::Uki { cmdline, .. } => { # 1661 + let allow_missing_fsverity = cmdline.is_some_and(|cmd| { # 1662 + ComposefsCmdline::find_in_cmdline(&cmd) # 1663 + .is_some_and(|cfs_cmdline| cfs_cmdline.allow_missing_fsverity) # 1664 + }); # 1665 + # 1666 + if !allow_missing_fsverity { # 1667 + anyhow::ensure!( # 1668 + root_filesystem.supports_fsverity(), # 1669 + "Specified filesystem {root_filesystem} does not support fs-verity" # 1670 + ); # 1671 + } # 1672 + # 1673 + composefs_options.allow_missing_verity = allow_missing_fsverity; # 1674 + is_uki = true; # 1675 + } # 1676 + # 1677 + crate::kernel::KernelType::Vmlinuz { .. } => {} # 1678 + } } # | Error: CLIPPY_WARNING: [#def46] crates/lib/src/install.rs:2025:24: warning: called `.as_ref().map(|s| s.as_str())` on an `Option` value # | # 2025 | let source_image = opts # | ________________________^ # 2026 | | .source_opts # 2027 | | .source_imgref # 2028 | | .as_ref() # 2029 | | .map(|s| s.as_str()) # | |____________________________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#option_as_ref_deref # = note: `#[warn(clippy::option_as_ref_deref)]` on by default # help: consider using as_deref # | # 2025 ~ let source_image = opts # 2026 + .source_opts # 2027 + .source_imgref.as_deref() # | Error: CLIPPY_WARNING: [#def47] crates/lib/src/install.rs:2353:24: warning: called `.as_ref().map(|s| s.as_str())` on an `Option` value # | # 2353 | let source_image = opts # | ________________________^ # 2354 | | .source_opts # 2355 | | .source_imgref # 2356 | | .as_ref() # 2357 | | .map(|s| s.as_str()) # | |____________________________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#option_as_ref_deref # help: consider using as_deref # | # 2353 ~ let source_image = opts # 2354 + .source_opts # 2355 + .source_imgref.as_deref() # | Error: CLIPPY_WARNING: [#def48] crates/lib/src/install.rs:2635:24: warning: called `.as_ref().map(|s| s.as_str())` on an `Option` value # | # 2635 | let source_image = opts # | ________________________^ # 2636 | | .source_opts # 2637 | | .source_imgref # 2638 | | .as_ref() # 2639 | | .map(|s| s.as_str()) # | |____________________________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#option_as_ref_deref # help: consider using as_deref # | # 2635 ~ let source_image = opts # 2636 + .source_opts # 2637 + .source_imgref.as_deref() # | Error: CLIPPY_WARNING: [#def49] crates/lib/src/lints.rs:773:43: warning: useless conversion to the same type: `cap_std_ext::cap_std::fs::ReadDir` # | # 773 | let entries: Result<BTreeSet<_>, _> = d # | ___________________________________________^ # 774 | | .entries()? # 775 | | .into_iter() # | |____________________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#useless_conversion # help: consider removing `.into_iter()` # | # 773 ~ let entries: Result<BTreeSet<_>, _> = d # 774 + .entries()? # | Error: CLIPPY_WARNING: [#def50] crates/lib/src/parsers/bls_config.rs:22:5: warning: name `EFI` contains a capitalized acronym # | # 22 | EFI { # | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Efi` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#upper_case_acronyms # = note: `#[warn(clippy::upper_case_acronyms)]` on by default Error: CLIPPY_WARNING: [#def51] crates/lib/src/parsers/bls_config.rs:179:28: warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator # | # 179 | let name = efi # | ____________________________^ # 180 | | .components() # 181 | | .last() # | |______________________-----^ # | | # | help: try: `next_back()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#double_ended_iterator_last Error: CLIPPY_WARNING: [#def52] crates/lib/src/parsers/grub_menuconfig.rs:114:20: warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator # | # 114 | let name = to_path # | ____________________^ # 115 | | .components() # 116 | | .last() # | |______________-----^ # | | # | help: try: `next_back()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#double_ended_iterator_last Error: CLIPPY_WARNING: [#def53] crates/lib/src/parsers/grub_menuconfig.rs:143:22: warning: redundant guard # | # 143 | c if c == '\\' => { # | ^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#redundant_guards # = note: `#[warn(clippy::redundant_guards)]` on by default # help: try # | # 143 - c if c == '\\' => { # 143 + '\\' => { # | Error: CLIPPY_WARNING: [#def54] crates/lib/src/podstorage.rs:165:35: warning: the following explicit lifetimes could be elided: 'c # | # 165 | pub fn set_additional_image_store<'c>( # | ^^ # 166 | cmd: &'c mut Command, # | ^^ # 167 | ais: impl AsRef<Utf8Path>, # 168 | ) -> &'c mut Command { # | ^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_lifetimes # = note: `#[warn(clippy::needless_lifetimes)]` on by default # help: elide the lifetimes # | # 165 ~ pub fn set_additional_image_store( # 166 ~ cmd: &mut Command, # 167 | ais: impl AsRef<Utf8Path>, # 168 ~ ) -> &mut Command { # | Error: CLIPPY_WARNING: [#def55] crates/lib/src/store/mod.rs:396:17: warning: returning the result of a `let` binding from a block # | # 392 | / let boot_dir = boot_dir # 393 | | .open_dir(EFI_LINUX) # 394 | | .with_context(|| format!("Opening {EFI_LINUX}"))?; # | |______________________________________________________________________- unnecessary `let` binding # 395 | # 396 | boot_dir # | ^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#let_and_return # help: return the expression directly # | # 392 ~ # 393 | # 394 ~ boot_dir # 395 + .open_dir(EFI_LINUX) # 396 + .with_context(|| format!("Opening {EFI_LINUX}"))? # | Error: CLIPPY_WARNING: [#def56] crates/lib/src/utils.rs:246:13: warning: unneeded `return` statement # | # 246 | return Ok(loader); # | ^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # help: remove `return` # | # 246 - return Ok(loader); # 246 + Ok(loader) # | Error: CLIPPY_WARNING: [#def57] crates/lib/src/utils.rs:250:13: warning: unneeded `return` statement # | # 250 | return Err(EfiError::MissingVar); # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # help: remove `return` # | # 250 - return Err(EfiError::MissingVar); # 250 + Err(EfiError::MissingVar) # | Error: CLIPPY_WARNING: [#def58] crates/lib/src/utils.rs:270:14: warning: this `repeat().take()` can be written more concisely # | # 270 | let up = std::iter::repeat(Component::ParentDir).take(from.len() - common); # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(Component::ParentDir, from.len() - common)` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#manual_repeat_n # = note: `#[warn(clippy::manual_repeat_n)]` on by default Error: CLIPPY_WARNING: [#def59] crates/lib/src/utils.rs:276:5: warning: unneeded `return` statement # | # 276 | return Ok(final_path); # | ^^^^^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_return # help: remove `return` # | # 276 - return Ok(final_path); # 276 + Ok(final_path) # | Error: CLIPPY_WARNING: [#def60] crates/ostree-ext/src/cli.rs:797:9: warning: this `if` statement can be collapsed # | # 797 | / if let Some(ordered) = raw.ordered { # 798 | | if ordered { # 799 | | return Err(anyhow::anyhow!("Ordered mapping not currently supported.")); # 800 | | } # 801 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # = note: `#[warn(clippy::collapsible_if)]` on by default # help: collapse nested if block # | # 797 ~ if let Some(ordered) = raw.ordered # 798 ~ && ordered { # 799 | return Err(anyhow::anyhow!("Ordered mapping not currently supported.")); # 800 ~ } # | Error: CLIPPY_WARNING: [#def61] crates/ostree-ext/src/container/store.rs:607:9: warning: this `if` statement can be collapsed # | # 607 | / if let Some(meta) = root.symlink_metadata_optional(ent)? { # 608 | | if meta.is_file() && meta.size() == 0 { # 609 | | tracing::debug!("Removing {ent}"); # 610 | | root.remove_file(ent)?; # 611 | | } # 612 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 607 ~ if let Some(meta) = root.symlink_metadata_optional(ent)? # 608 ~ && meta.is_file() && meta.size() == 0 { # 609 | tracing::debug!("Removing {ent}"); # 610 | root.remove_file(ent)?; # 611 ~ } # | Error: CLIPPY_WARNING: [#def62] crates/ostree-ext/src/container/store.rs:1190:5: warning: this function has too many arguments (10/7) # | # 1190 | / fn write_merge_commit_impl( # 1191 | | repo: &ostree::Repo, # 1192 | | base_commit: Option<&str>, # 1193 | | layer_commits: &[String], # ... | # 1200 | | cancellable: Option<&gio::Cancellable>, # 1201 | | ) -> Result<Box<LayeredImageState>> { # | |_______________________________________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#too_many_arguments # = note: `#[warn(clippy::too_many_arguments)]` on by default Error: CLIPPY_WARNING: [#def63] crates/ostree-ext/src/container/store.rs:1289:22: warning: derefed type is same as origin # | # 1289 | let parent = base_commit.as_deref(); # | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `base_commit` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_option_as_deref # = note: `#[warn(clippy::needless_option_as_deref)]` on by default Error: CLIPPY_WARNING: [#def64] crates/ostree-ext/src/container/store.rs:1831:36: warning: using `clone` on type `Option<&History>` which implements the `Copy` trait # | # 1831 | let previous_description = history_entry # | ____________________________________^ # 1832 | | .clone() # | |____________________^ help: try removing the `clone` call: `history_entry` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#clone_on_copy # = note: `#[warn(clippy::clone_on_copy)]` on by default Error: CLIPPY_WARNING: [#def65] crates/ostree-ext/src/container/unencapsulate.rs:224:13: warning: this `if` statement can be collapsed # | # 224 | / if transport_src == Transport::DockerDaemon { # 225 | | if let oci_image::MediaType::Other(t) = &media_type { # 226 | | if t.as_str() == "application/vnd.docker.image.rootfs.diff.tar.gzip" { # 227 | | media_type = oci_image::MediaType::Other( # ... | # 232 | | } # | |_____________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 224 ~ if transport_src == Transport::DockerDaemon # 225 ~ && let oci_image::MediaType::Other(t) = &media_type { # 226 | if t.as_str() == "application/vnd.docker.image.rootfs.diff.tar.gzip" { # ... # 230 | } # 231 ~ } # | Error: CLIPPY_WARNING: [#def66] crates/ostree-ext/src/container/unencapsulate.rs:225:17: warning: this `if` statement can be collapsed # | # 225 | / if let oci_image::MediaType::Other(t) = &media_type { # 226 | | if t.as_str() == "application/vnd.docker.image.rootfs.diff.tar.gzip" { # 227 | | media_type = oci_image::MediaType::Other( # 228 | | "application/vnd.docker.image.rootfs.diff.tar".to_string(), # ... | # 231 | | } # | |_________________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 225 ~ if let oci_image::MediaType::Other(t) = &media_type # 226 ~ && t.as_str() == "application/vnd.docker.image.rootfs.diff.tar.gzip" { # 227 | media_type = oci_image::MediaType::Other( # 228 | "application/vnd.docker.image.rootfs.diff.tar".to_string(), # 229 | ); # 230 ~ } # | Error: CLIPPY_WARNING: [#def67] crates/ostree-ext/src/logging.rs:24:5: warning: this `if` statement can be collapsed # | # 24 | / if let Err(e) = libsystemd::logging::journal_send(priority, msg, vars) { # 25 | | if !EMITTED_JOURNAL_ERROR.swap(true, Ordering::SeqCst) { # 26 | | eprintln!("failed to write to journal: {e}"); # 27 | | } # 28 | | } # | |_____^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 24 ~ if let Err(e) = libsystemd::logging::journal_send(priority, msg, vars) # 25 ~ && !EMITTED_JOURNAL_ERROR.swap(true, Ordering::SeqCst) { # 26 | eprintln!("failed to write to journal: {e}"); # 27 ~ } # | Error: CLIPPY_WARNING: [#def68] crates/ostree-ext/src/ostree_prepareroot.rs:105:1: warning: this `impl` can be derived # | # 105 | / impl Default for Tristate { # 106 | | fn default() -> Self { # 107 | | Self::Disabled # 108 | | } # 109 | | } # | |_^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#derivable_impls # = note: `#[warn(clippy::derivable_impls)]` on by default # help: replace the manual implementation with a derive attribute and mark the default variant # | # 81 + #[derive(Default)] # 82 | pub enum Tristate { # 83 | /// Enabled # 84 | Enabled, # 85 | /// Disabled # 86 ~ #[default] # 87 ~ Disabled, # | Error: CLIPPY_WARNING: [#def69] crates/ostree-ext/src/sysroot.rs:107:5: warning: this `let...else` may be rewritten with the `?` operator # | # 107 | / let Some(statename) = name.strip_prefix(AUTO_STATEROOT_PREFIX) else { # 108 | | return None; # 109 | | }; # | |______^ help: replace it with: `let statename = name.strip_prefix(AUTO_STATEROOT_PREFIX)?;` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#question_mark # = note: `#[warn(clippy::question_mark)]` on by default Error: CLIPPY_WARNING: [#def70] crates/ostree-ext/src/sysroot.rs:110:5: warning: this `let...else` may be rewritten with the `?` operator # | # 110 | / let Some((year, serial)) = statename.split_once("-") else { # 111 | | return None; # 112 | | }; # | |______^ help: replace it with: `let (year, serial) = statename.split_once("-")?;` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#question_mark Error: CLIPPY_WARNING: [#def71] crates/tests-integration/src/anaconda.rs:728:26: warning: needless call to `as_bytes` # | # 728 | let mut end = (idx + pattern.as_bytes().len() + 200).min(content.as_bytes().len()); # | ^^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `pattern.len()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_as_bytes # = note: `#[warn(clippy::needless_as_bytes)]` on by default Error: CLIPPY_WARNING: [#def72] crates/tests-integration/src/anaconda.rs:728:62: warning: needless call to `as_bytes` # | # 728 | let mut end = (idx + pattern.as_bytes().len() + 200).min(content.as_bytes().len()); # | ^^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `content.len()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_as_bytes Error: CLIPPY_WARNING: [#def73] crates/tests-integration/src/anaconda.rs:729:17: warning: needless call to `as_bytes` # | # 729 | while end < content.as_bytes().len() && !content.is_char_boundary(end) { # | ^^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `content.len()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_as_bytes Error: CLIPPY_WARNING: [#def74] crates/tests-integration/src/container.rs:56:5: warning: matching on `Some` with `ok()` is redundant # | # 56 | if let Some(variant) = std::env::var("BOOTC_variant").ok() { # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#match_result_ok # = note: `#[warn(clippy::match_result_ok)]` on by default # help: consider matching on `Ok(variant)` and removing the call to `ok` instead # | # 56 - if let Some(variant) = std::env::var("BOOTC_variant").ok() { # 56 + if let Ok(variant) = std::env::var("BOOTC_variant") { # | Error: CLIPPY_WARNING: [#def75] crates/tests-integration/src/container.rs:163:5: warning: matching on `Some` with `ok()` is redundant # | # 163 | if let Some(variant) = std::env::var("BOOTC_variant").ok() { # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#match_result_ok # help: consider matching on `Ok(variant)` and removing the call to `ok` instead # | # 163 - if let Some(variant) = std::env::var("BOOTC_variant").ok() { # 163 + if let Ok(variant) = std::env::var("BOOTC_variant") { # | Error: CLIPPY_WARNING: [#def76] crates/tests-integration/src/container.rs:176:5: warning: matching on `Some` with `ok()` is redundant # | # 176 | if let Some(base) = std::env::var("BOOTC_base").ok() { # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#match_result_ok # help: consider matching on `Ok(base)` and removing the call to `ok` instead # | # 176 - if let Some(base) = std::env::var("BOOTC_base").ok() { # 176 + if let Ok(base) = std::env::var("BOOTC_base") { # | Error: CLIPPY_WARNING: [#def77] crates/tests-integration/src/container.rs:312:9: warning: needless call to `as_bytes` # | # 312 | digest.as_bytes().len(), # | ^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `digest.len()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_as_bytes Error: CLIPPY_WARNING: [#def78] crates/tests-integration/src/container.rs:315:9: warning: needless call to `as_bytes` # | # 315 | digest.as_bytes().len() # | ^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `digest.len()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#needless_as_bytes Error: CLIPPY_WARNING: [#def79] crates/tmpfiles/src/lib.rs:86:5: warning: this `if` statement can be collapsed # | # 86 | / if let Ok(s) = path.as_os_str().as_str() { # 87 | | if s.chars().all(|c| c.is_ascii_alphanumeric() || c == '/') { # 88 | | return write!(out, "{s}"); # 89 | | } # 90 | | } # | |_____^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # = note: `#[warn(clippy::collapsible_if)]` on by default # help: collapse nested if block # | # 86 ~ if let Ok(s) = path.as_os_str().as_str() # 87 ~ && s.chars().all(|c| c.is_ascii_alphanumeric() || c == '/') { # 88 | return write!(out, "{s}"); # 89 ~ } # | Error: CLIPPY_WARNING: [#def80] crates/tmpfiles/src/lib.rs:252:5: warning: this `if` statement can be collapsed # | # 252 | / if let Some(meta) = rootfs.symlink_metadata_optional("var/run")? { # 253 | | if !meta.is_symlink() { # 254 | | return Err(Error::FoundVarRunNonSymlink {}); # 255 | | } # 256 | | } # | |_____^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 252 ~ if let Some(meta) = rootfs.symlink_metadata_optional("var/run")? # 253 ~ && !meta.is_symlink() { # 254 | return Err(Error::FoundVarRunNonSymlink {}); # 255 ~ } # | Error: CLIPPY_WARNING: [#def81] crates/tmpfiles/src/lib.rs:477:9: warning: this `if` statement can be collapsed # | # 477 | / if let Ok(s) = stem.as_str() { # 478 | | if s.starts_with(BOOTC_GENERATED_PREFIX) { # 479 | | generation.increment(); # 480 | | } # 481 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 477 ~ if let Ok(s) = stem.as_str() # 478 ~ && s.starts_with(BOOTC_GENERATED_PREFIX) { # 479 | generation.increment(); # 480 ~ } # | Error: CLIPPY_WARNING: [#def82] crates/utils/src/path.rs:24:9: warning: this `if` statement can be collapsed # | # 24 | / if let Some(s) = self.path.to_str() { # 25 | | if s.chars().all(is_shellsafe) { # 26 | | return f.write_str(s); # 27 | | } # 28 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # = note: `#[warn(clippy::collapsible_if)]` on by default # help: collapse nested if block # | # 24 ~ if let Some(s) = self.path.to_str() # 25 ~ && s.chars().all(is_shellsafe) { # 26 | return f.write_str(s); # 27 ~ } # | Error: CLIPPY_WARNING: [#def83] crates/xtask/src/man.rs:309:13: warning: returning the result of a `let` binding from a block # | # 308 | let path = find_command_path_for_filename(cli_structure, cmd_part); # | ------------------------------------------------------------------- unnecessary `let` binding # 309 | path # | ^^^^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#let_and_return # = note: `#[warn(clippy::let_and_return)]` on by default # help: return the expression directly # | # 308 ~ # 309 ~ find_command_path_for_filename(cli_structure, cmd_part) # | Error: CLIPPY_WARNING: [#def84] crates/xtask/src/man.rs:606:5: warning: empty string literal in `println!` # | # 606 | println!(""); # | ^^^^^^^^^--^ # | | # | help: remove the empty string # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#println_empty_string # = note: `#[warn(clippy::println_empty_string)]` on by default Error: CLIPPY_WARNING: [#def85] crates/xtask/src/man.rs:622:12: warning: this `map_or` can be simplified # | # 622 | if path # | ____________^ # 623 | | .extension() # 624 | | .and_then(|s| s.to_str()) # 625 | | .map_or(false, |e| e.chars().all(|c| c.is_numeric())) # | |_________________________________________________________________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unnecessary_map_or # = note: `#[warn(clippy::unnecessary_map_or)]` on by default # help: use is_some_and instead # | # 625 - .map_or(false, |e| e.chars().all(|c| c.is_numeric())) # 625 + .is_some_and(|e| e.chars().all(|c| c.is_numeric())) # | Error: CLIPPY_WARNING: [#def86] crates/xtask/src/tmt.rs:175:9: warning: this `if` statement can be collapsed # | # 175 | / if let Ok(json_output) = cmd!(sh, "bcvk libvirt inspect {vm_name} --format=json") # 176 | | .ignore_stderr() # 177 | | .read() # ... | # 188 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # = note: `#[warn(clippy::collapsible_if)]` on by default # help: collapse nested if block # | # 177 ~ .read() # 178 ~ && let Ok(json) = serde_json::from_str::<serde_json::Value>(&json_output) { # 179 | if let (Some(ssh_port), Some(ssh_key)) = ( # ... # 185 | } # 186 ~ } # | Error: CLIPPY_WARNING: [#def87] crates/xtask/src/tmt.rs:179:13: warning: this `if` statement can be collapsed # | # 179 | / if let Ok(json) = serde_json::from_str::<serde_json::Value>(&json_output) { # 180 | | if let (Some(ssh_port), Some(ssh_key)) = ( # 181 | | json.get("ssh_port").and_then(|v| v.as_u64()), # 182 | | json.get("ssh_private_key").and_then(|v| v.as_str()), # ... | # 187 | | } # | |_____________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 179 ~ if let Ok(json) = serde_json::from_str::<serde_json::Value>(&json_output) # 180 ~ && let (Some(ssh_port), Some(ssh_key)) = ( # 181 | json.get("ssh_port").and_then(|v| v.as_u64()), # ... # 185 | return Ok((ssh_port, ssh_key.to_string())); # 186 ~ } # | Error: CLIPPY_WARNING: [#def88] crates/xtask/src/tmt.rs:279:9: warning: this `if` statement can be collapsed # | # 279 | / if let Some(try_bind) = plan_data.get(&serde_yaml::Value::String(format!( # 280 | | "extra-{}", # 281 | | FIELD_TRY_BIND_STORAGE # 282 | | ))) { # ... | # 292 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 282 ~ ))) # 283 ~ && let Some(b) = try_bind.as_bool() { # 284 | plan_metadata # ... # 290 | }); # 291 ~ } # | Error: CLIPPY_WARNING: [#def89] crates/xtask/src/tmt.rs:294:9: warning: this `if` statement can be collapsed # | # 294 | / if let Some(works_for_composefs) = plan_data.get(&serde_yaml::Value::String(format!( # 295 | | "extra-{}", # 296 | | FIELD_FIXME_SKIP_IF_COMPOSEFS # 297 | | ))) { # ... | # 307 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 297 ~ ))) # 298 ~ && let Some(b) = works_for_composefs.as_bool() { # 299 | plan_metadata # ... # 305 | }); # 306 ~ } # | Error: CLIPPY_WARNING: [#def90] crates/xtask/src/tmt.rs:333:32: warning: useless use of `format!` # | # 333 | .chain(std::iter::once(format!("--context=running_env=image_mode"))) # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"--context=running_env=image_mode".to_string()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#useless_format # = note: `#[warn(clippy::useless_format)]` on by default Error: CLIPPY_WARNING: [#def91] crates/xtask/src/tmt.rs:371:26: warning: useless use of `format!` # | # 371 | .with_context(|| format!("Saving container image to tar"))?; # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Saving container image to tar".to_string()` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#useless_format Error: CLIPPY_WARNING: [#def92] crates/xtask/src/tmt.rs:479:13: warning: this `if` statement can be collapsed # | # 479 | / if variant_id == "coreos" { # 480 | | if distro.starts_with("fedora") { # 481 | | opts.push("--filesystem=xfs".to_string()); # 482 | | } # 483 | | } # | |_____________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 479 ~ if variant_id == "coreos" # 480 ~ && distro.starts_with("fedora") { # 481 | opts.push("--filesystem=xfs".to_string()); # 482 ~ } # | Error: CLIPPY_WARNING: [#def93] crates/xtask/src/tmt.rs:1072:5: warning: calling `push_str()` using a single-character string literal # | # 1072 | tests_content.push_str("\n"); # | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tests_content.push('\n')` # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#single_char_add_str # = note: `#[warn(clippy::single_char_add_str)]` on by default Error: CLIPPY_WARNING: [#def94] crates/xtask/src/tmt.rs:1095:9: warning: this `if` statement can be collapsed # | # 1095 | / if let serde_yaml::Value::Mapping(map) = &test.tmt { # 1096 | | if let Some(summary) = map.get(&serde_yaml::Value::String(FIELD_SUMMARY.to_string())) { # 1097 | | plan_value.insert( # 1098 | | serde_yaml::Value::String(FIELD_SUMMARY.to_string()), # ... | # 1102 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 1095 ~ if let serde_yaml::Value::Mapping(map) = &test.tmt # 1096 ~ && let Some(summary) = map.get(&serde_yaml::Value::String(FIELD_SUMMARY.to_string())) { # 1097 | plan_value.insert( # ... # 1100 | ); # 1101 ~ } # | Error: CLIPPY_WARNING: [#def95] crates/xtask/src/tmt.rs:1121:9: warning: this `if` statement can be collapsed # | # 1121 | / if let serde_yaml::Value::Mapping(map) = &test.tmt { # 1122 | | if let Some(adjust) = map.get(&serde_yaml::Value::String(FIELD_ADJUST.to_string())) { # 1123 | | plan_value.insert( # 1124 | | serde_yaml::Value::String(FIELD_ADJUST.to_string()), # ... | # 1128 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 1121 ~ if let serde_yaml::Value::Mapping(map) = &test.tmt # 1122 ~ && let Some(adjust) = map.get(&serde_yaml::Value::String(FIELD_ADJUST.to_string())) { # 1123 | plan_value.insert( # ... # 1126 | ); # 1127 ~ } # | Error: CLIPPY_WARNING: [#def96] crates/xtask/src/xtask.rs:224:9: warning: this `if` statement can be collapsed # | # 224 | / if let Ok(toplevel_path) = Command::new("git") # 225 | | .args(["rev-parse", "--show-toplevel"]) # 226 | | .output() # ... | # 232 | | } # | |_________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 226 ~ .output() # 227 ~ && toplevel_path.status.success() { # 228 | let path = String::from_utf8(toplevel_path.stdout)?; # 229 | std::env::set_current_dir(path.trim()).context("Changing to toplevel")?; # 230 ~ } # | Error: CLIPPY_WARNING: [#def97] crates/xtask/src/xtask.rs:415:13: warning: this `if` statement can be collapsed # | # 415 | / if let Some(name) = name.to_str() { # 416 | | if name.ends_with(".src.rpm") { # 417 | | sh.remove_path(name)?; # 418 | | } # 419 | | } # | |_____________^ # | # = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if # help: collapse nested if block # | # 415 ~ if let Some(name) = name.to_str() # 416 ~ && name.ends_with(".src.rpm") { # 417 | sh.remove_path(name)?; # 418 ~ } # |
| analyzer-version-clippy | 1.94.0 |
| analyzer-version-cppcheck | 2.20.0 |
| analyzer-version-gcc | 16.0.1 |
| analyzer-version-gcc-analyzer | 16.0.1 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-155.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20260320.200800.gd35503f.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | bootc-202603201912.ga2edd7c979-1 |
| store-results-to | /tmp/tmpfyss38a9/bootc-202603201912.ga2edd7c979-1.tar.xz |
| time-created | 2026-03-20 20:57:37 |
| time-finished | 2026-03-20 21:21:33 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,gcc,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpfyss38a9/bootc-202603201912.ga2edd7c979-1.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpfyss38a9/bootc-202603201912.ga2edd7c979-1.src.rpm' |
| tool-version | csmock-3.8.4.20260302.153719.g8203630-1.el9 |