【Rust】CodeCollection
概述: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>())
}
【Rust】CodeCollection
https://hodlyounger.github.io/2024/08/07/B_Code/Rust/【Rust】CodeCollect/