add tuple access functor-macro
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
16f82b02a0
commit
a5e85727b5
1 changed files with 7 additions and 0 deletions
|
@ -39,3 +39,10 @@ pub use self::{
|
|||
|
||||
#[inline]
|
||||
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
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue