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