Skip to main content

apply_change

Function apply_change 

Source
pub fn apply_change(
    key: SettingKey,
    s: &mut Settings,
    new: String,
) -> Result<()>
Expand description

Apply a scalar edit.

new is the stringified new value:

  • Toggle: "true" / "false"
  • Cycle: the variant’s Display form
  • SubmenuSelect: one of the allowed strings
  • Text: free-form, parsed via FromStr on the target field type

Returns Err on:

  • parse failure (unknown cycle variant, non-numeric text)
  • edits to DisabledTools / ModelRoles / Keybindings (their structured editors own those fields — must not silently no-op)
  • edits to any Pointer row (read-only by design)