From 6fe9aa946f5c0a81415a9f949e944ccf6f46cddf Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 27 Jun 2024 13:43:41 -0400 Subject: [PATCH] kargs: Drop unnecessary `mut` By passing ownership of the vector here we don't need to make it `mut`able. Signed-off-by: Colin Walters --- lib/src/kargs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/kargs.rs b/lib/src/kargs.rs index 9983b48b8..280f760dc 100644 --- a/lib/src/kargs.rs +++ b/lib/src/kargs.rs @@ -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 = get_kargs_in_root(root, sys_arch)?; + let existing_kargs: Vec = get_kargs_in_root(root, sys_arch)?; // Get the kargs in kargs.d of the pending image let mut remote_kargs: Vec = vec![]; @@ -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";