add tuple access functor-macro

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-09-29 09:01:57 +00:00 committed by strawberry
parent 16f82b02a0
commit a5e85727b5

View file

@ -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
};
}