pounder_test/src/lib.rs

19 lines
605 B
Rust
Raw Normal View History

#![no_std]
#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
pub mod hardware;
2021-03-18 03:16:13 +08:00
pub mod net;
2021-06-01 23:55:42 +08:00
/// Macro to reduce rightward drift when calling the same closure-based API
/// on multiple structs simultaneously, e.g. when accessing DMA buffers.
/// This could be improved a bit using the tuple-based style from `mutex-trait`.
#[macro_export]
macro_rules! flatten_closures {
($fn:ident, $e:ident, $fun:block) => {
$e.$fn(|$e| $fun ).unwrap()
};
($fn:ident, $e:ident, $($es:ident),+, $fun:block) => {
$e.$fn(|$e| flatten_closures!($fn, $($es),*, $fun)).unwrap()
};
}