rasn_compiler/intermediate/
utils.rs

1macro_rules! get_declaration {
2    ($tlds:ident, $key:expr, $tld_ty:ident, $asn1_ty:path) => {{
3        if let Some(tld) = $tlds.get($key) {
4            match tld {
5                ToplevelDefinition::$tld_ty(inner) => match inner.pdu() {
6                    $asn1_ty(asn) => Some(asn),
7                    _ => None,
8                },
9                _ => None,
10            }
11        } else {
12            None
13        }
14    }};
15}
16
17pub(crate) use get_declaration;