add tuple access functor-macro
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -39,3 +39,10 @@ pub use self::{
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn exchange<T>(state: &mut T, source: T) -> T { std::mem::replace(state, source) }
|
pub fn exchange<T>(state: &mut T, source: T) -> T { std::mem::replace(state, source) }
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! at {
|
||||||
|
($idx:tt) => {
|
||||||
|
|t| t.$idx
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user