Introduce extract!(), rewrite part of uiaa username handling

This commit is contained in:
dasha_uwu
2026-01-17 07:20:23 +05:00
committed by Jason Volk
parent c0aaeefaf2
commit 62ec58b1ed
2 changed files with 15 additions and 11 deletions

View File

@@ -61,6 +61,16 @@ macro_rules! extract_variant {
};
}
#[macro_export]
macro_rules! extract {
($e:expr_2021, $out:ident in $variant:pat) => {
match $e {
| $variant => Some($out),
| _ => None,
}
};
}
/// Functor for !is_empty()
#[macro_export]
macro_rules! is_not_empty {