Crate python_comm_macros[][src]

Expand description

在函数中自动设置局部变量 __func__ 为当前函数名

用法

use python_comm_macros::auto_func_name;

#[auto_func_name]
fn test_name() -> String {
  return String::from(__func__);
}

assert_eq!(test_name(), "test_name");

Bug

有 auto_func_name 属性的函数, 用 /// 产生的文档注释在 cargo doc 中为空

Attribute Macros

auto_func_name

在函数中自动设置局部变量 __func__ 为当前函数名