Skip to content

Commit

Permalink
kargs: Drop unnecessary allocation and mut
Browse files Browse the repository at this point in the history
We can just pass the iterator directly to `extend`.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jun 27, 2024
1 parent 6fe9aa9 commit 53e1f82
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/src/kargs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ pub(crate) fn get_kargs(
// Get the running kargs of the booted system
if let Some(bootconfig) = ostree::Deployment::bootconfig(booted_deployment) {
if let Some(options) = ostree::BootconfigParser::get(&bootconfig, "options") {
let options: Vec<&str> = options.split_whitespace().collect();
let mut options: Vec<String> = options.into_iter().map(|s| s.to_string()).collect();
kargs.append(&mut options);
let options = options.split_whitespace().map(|s| s.to_owned());
kargs.extend(options);
}
};

Expand Down

0 comments on commit 53e1f82

Please sign in to comment.