phab_lib/utils/
macros.rs

1// https://stackoverflow.com/questions/38088067/equivalent-of-func-or-function-in-rust
2macro_rules! function_name {
3  () => {{
4    fn f() {}
5    fn type_name_of<T>(_: T) -> &'static str {
6      std::any::type_name::<T>()
7    }
8    let name = type_name_of(f);
9    &name[..name.len() - 3]
10  }};
11}