https://rust.cc/article?id=143b7d22-f7d7-48cf-a945-3b0b5f22c360
抱歉啊,还是没有明白,我把问题再简化一下啊:
#[test]
fn test_result_0003(){
use std::num::ParseIntError;
let my_result : Result<i32, ParseIntError> ;
let number_str = "10";
my_result = number_str.parse::();
// type_of 是自定义的 std::any::type_name 函数
// println!("type is:{}", type_of(my_result));
// type is : core::result::Result<i32, core::num::ParseIntError>
登录后可查看完整内容,参与讨论!
立即登录