docs: add doc comments to macros

This commit is contained in:
🪞👃🪞 2024-07-06 20:37:17 +03:00
parent c5369328f4
commit 828436745c
7 changed files with 9 additions and 0 deletions

View file

@ -10,6 +10,7 @@ pub trait Handle {
}
}
/// Implement the `Handle` trait.
#[macro_export] macro_rules! handle {
($T:ty) => {
impl Handle for $T {}
@ -70,12 +71,14 @@ pub fn handle_keymap <T> (
Ok(false)
}
/// Define a key binding.
#[macro_export] macro_rules! key {
($k:ident $(($char:literal))?, $m:ident, $n: literal, $d: literal, $f: expr) => {
(KeyCode::$k $(($char))?, KeyModifiers::$m, $n, $d, &$f)
};
}
/// Define a keymap.
#[macro_export] macro_rules! keymap {
($T:ty { $([$k:ident $(($char:literal))?, $m:ident, $n: literal, $d: literal, $f: expr]),* $(,)? }) => {
&[