MCPcopy Create free account
hub / github.com/PowerShell/DSC / remove_entry

Function remove_entry

resources/sshdconfig/src/repeat_keyword.rs:328–333  ·  view source on GitHub ↗

Remove a keyword entry based on the keyword's name field. This function searches for and removes an entry with the specified name from the keyword's array in the configuration map. If the keyword or entry doesn't exist, the function has no effect. # Parameters `config` - A mutable reference to the configuration map `keyword` - The keyword name (e.g., "subsystem") `entry_name` - The name of the

(config: &mut Map<String, Value>, keyword: &str, entry_name: &str)

Source from the content-addressed store, hash-verified

326/// * `keyword` - The keyword name (e.g., "subsystem")
327/// * `entry_name` - The name of the entry to remove
328pub fn remove_entry(config: &mut Map<String, Value>, keyword: &str, entry_name: &str) {
329 if let Some(Value::Array(arr)) = config.get_mut(keyword)
330 && let Some(index) = find_name_value_entry_index(arr, entry_name, None) {
331 arr.remove(index);
332 }
333}

Callers 1

set_sshd_config_repeatFunction · 0.85

Calls 2

removeMethod · 0.80

Tested by

no test coverage detected