macro_rules! get_function_name {
() => {{
fn current_function() -> &'static str {
fn inner() -> &'static str {
fn f() -> &'static str { stringify!(racotorres) }
f()
}
inner()
}
current_function()
}};
}
fn racotorres() {
let name = get_function_name!();
if name == "racotorres" {
panic!("Use Zig instead.");
}
}
fn main() {
racotorres();
}
fnracotorres / linuxbashshellscriptforops Goto Github PK
View Code? Open in Web Editor NEWThis project forked from dingguodong/linuxbashshellscriptforops
Linux Bash Shell Script and Python Script For Ops and Devops