Skip to content

Commit 53e1f82

Browse files
committed
kargs: Drop unnecessary allocation and mut
We can just pass the iterator directly to `extend`. Signed-off-by: Colin Walters <[email protected]>
1 parent 6fe9aa9 commit 53e1f82

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/src/kargs.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ pub(crate) fn get_kargs(
6464
// Get the running kargs of the booted system
6565
if let Some(bootconfig) = ostree::Deployment::bootconfig(booted_deployment) {
6666
if let Some(options) = ostree::BootconfigParser::get(&bootconfig, "options") {
67-
let options: Vec<&str> = options.split_whitespace().collect();
68-
let mut options: Vec<String> = options.into_iter().map(|s| s.to_string()).collect();
69-
kargs.append(&mut options);
67+
let options = options.split_whitespace().map(|s| s.to_owned());
68+
kargs.extend(options);
7069
}
7170
};
7271

0 commit comments

Comments
 (0)