1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
macro_rules! tap { () => { /// Gives access to the value inside a method chain. /// /// # Examples /// /// ``` /// use hypotaxis::ChainLink; /// /// let passcode = 33344850294026550922u128; /// /// passcode /// .tap(|passcode| { /// #[cfg(debug_assertions)] /// dbg!(*passcode); /// }) /// .tap(|passcode| assert!(*passcode != 0)) /// ; /// ``` //from the tap crate fn tap<F>( self, func: F ) -> Self where F: FnOnce(&Self) { func(&self); self } }} pub(crate) use tap;