Skip to main content

remove_config_section

Function remove_config_section 

Source
pub fn remove_config_section(
    config_json: &str,
    section_name: &str,
) -> Result<String>
Expand description

Remove a configuration section

§Arguments

  • config_json - Configuration JSON string
  • section_name - Name of the section to remove

§Returns

Returns modified configuration JSON on success

§Example

use sz_configtool_lib::config_sections;

let config = r#"{"G2_CONFIG": {"CFG_CUSTOM": []}}"#;
let modified = config_sections::remove_config_section(config, "CFG_CUSTOM").unwrap();