4
我正在尝试使用BigInt
。我的代码是这样的:如何从数据包中解析BigInt?
extern crate num;
use num::bigint::BigInt;
...
println!("{}", from_str::<BigInt>("1")); //this is line 91 in the code
在我Cargo.toml文件我有以下几点:
[dependencies]
num = "0.1.30"
我似乎以匹配在this document,also this document也an answer here on Stack Overflow说。
不过,我得到了以下错误:
Compiling example v0.1.0 (file:///C:/src/rust/example)
src\main.rs:91:20: 91:38 error: unresolved name `from_str` [E0425]
src\main.rs:91 println!("{}", from_str::<BigInt>("1"));
只是为了清楚地说明:所有使用'from_str'的例子都过时了,这个函数已经被删除了,并且支持'.parse'。 – kirelagin