refactor: add Default derives to CmdRegistry and Keymap

Add #[derive(Default)] to CmdRegistry and Keymap structs, enabling
easy construction of empty instances with CmdRegistry::default() and
Keymap::default().

This simplifies initialization code and follows Rust conventions for
types that hold empty collections as their default state.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
This commit is contained in:
Edward Langley
2026-04-05 01:07:08 -07:00
parent d3a1a57c78
commit 872c4c6c5d
2 changed files with 2 additions and 0 deletions

View File

@ -69,6 +69,7 @@ struct CmdEntry {
}
/// Registry of commands constructible from text or from interactive context.
#[derive(Default)]
pub struct CmdRegistry {
entries: Vec<CmdEntry>,
}

View File

@ -75,6 +75,7 @@ pub enum Binding {
}
/// A keymap maps key patterns to bindings (command names or prefix sub-keymaps).
#[derive(Default)]
pub struct Keymap {
bindings: HashMap<KeyPattern, Binding>,
}