pub mod bucket_stats;
pub mod error;
pub mod globals;
pub mod last_minute;

// is ','
pub static DEFAULT_DELIMITER: u8 = 44;

/// Defers evaluation of a block of code until the end of the scope.
#[macro_export]
macro_rules! defer {
    ($($body:tt)*) => {
        let _guard = {
            pub struct Guard<F: FnOnce()>(Option<F>);

            impl<F: FnOnce()> Drop for Guard<F> {
                fn drop(&mut self) {
                    (self.0).take().map(|f| f());
                }
            }

            Guard(Some(|| {
                let _ = { $($body)* };
            }))
        };
    };
}
