dynamically import null funcs (all with the same signature)

This commit is contained in:
Mackenzie Clark
2019-03-26 18:59:39 -07:00
parent ad897b2076
commit 0533a4eef6
2 changed files with 49 additions and 4 deletions

View File

@ -75,3 +75,15 @@ macro_rules! __imports_internal {
$ns
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! ecapseman {
( $( $imp_name:expr => $import_item:expr, )* ) => {{
let mut ns = $crate::import::Namespace::new();
$(
ns.insert($imp_name, $import_item);
)*
ns
}};
}