1
2
3
4
5
6
7
8
9
10
11
use std::mem;

#[inline(always)]
pub fn to_static<T>(ptr: &T) -> &'static T {
    unsafe { mem::transmute(ptr) }
}

pub fn print_n_exit(msg: &str) -> ! {
    eprintln!("{}", msg);
    std::process::exit(1)
}