我正在尝试使用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"
我所做的似乎与这个文档、还有这个文档以及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