如何安全地转换整数?
How to safely cast integers?
曾经有一个 fn std::num::cast
可以在整数类型和 return 之间进行转换 Option
(如果转换无效,returning None
).该功能去哪儿了?
与之前的 , that functionality moved to num crate. More precisely, It's in num::traits::cast 类似。
曾经有一个 fn std::num::cast
可以在整数类型和 return 之间进行转换 Option
(如果转换无效,returning None
).该功能去哪儿了?
与之前的