MCPcopy Create free account
hub / github.com/bootc-dev/bootc / remove

Method remove

crates/kernel_cmdline/src/bytes.rs:301–318  ·  view source on GitHub ↗

Remove parameter(s) with the given key from the command line Returns `true` if parameter(s) were removed.

(&mut self, key: &ParameterKey)

Source from the content-addressed store, hash-verified

299 ///
300 /// Returns `true` if parameter(s) were removed.
301 pub fn remove(&mut self, key: &ParameterKey) -> bool {
302 let mut removed = false;
303 let mut new_params = Vec::new();
304
305 for p in self.iter() {
306 if p.key == *key {
307 removed = true;
308 } else {
309 new_params.push(p.parameter);
310 }
311 }
312
313 if removed {
314 self.0 = Cow::Owned(new_params.join(b" ".as_slice()));
315 }
316
317 removed
318 }
319
320 /// Remove all parameters that exactly match the given parameter
321 /// from the command line

Callers

nothing calls this directly

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected