Skip to content

Commit

Permalink
kargs: Drop unnecessary mut
Browse files Browse the repository at this point in the history
By passing ownership of the vector here we don't need to make
it `mut`able.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jun 27, 2024
1 parent fd80292 commit 6fe9aa9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/kargs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub(crate) fn get_kargs(

// Get the kargs in kargs.d of the booted system
let root = &cap_std::fs::Dir::open_ambient_dir("/", cap_std::ambient_authority())?;
let mut existing_kargs: Vec<String> = get_kargs_in_root(root, sys_arch)?;
let existing_kargs: Vec<String> = get_kargs_in_root(root, sys_arch)?;

// Get the kargs in kargs.d of the pending image
let mut remote_kargs: Vec<String> = vec![];
Expand All @@ -83,7 +83,7 @@ pub(crate) fn get_kargs(
.expect("downcast");
if !fetched_tree.query_exists(cancellable) {
// if the kargs.d directory does not exist in the fetched image, return the existing kargs
kargs.append(&mut existing_kargs);
kargs.extend(existing_kargs);
return Ok(kargs);
}
let queryattrs = "standard::name,standard::type";
Expand Down

0 comments on commit 6fe9aa9

Please sign in to comment.