文章目录
概述:Rust 代码整理
- 打印类型
1
2
3
4// Get the type of given variable, return a string representation of the type , e.g "i8", "u8", "i32", "u32"
fn type_of<T>(_: &T) -> String {
format!("{}", std::any::type_name::<T>())
}