How to Export Macros from a Crate in Rust

Add the #[macro_export] attribute to your macro_rules! definition to make it public to dependent crates.

Add the #[macro_export] attribute above your macro_rules! definition to make the macro available to other crates that depend on yours.

#[macro_export]
macro_rules! vec {
    ( $( $x:expr ),* ) => {
        {
            let mut temp_vec = Vec::new();
            $(
                temp_vec.push($x);
            )*
            temp_vec
        }
    };
}