概述:Rust 代码整理
- 打印类型
// 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>()) }
概述:Rust 代码整理
// 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>())
}