The plain function from_str
has been removed in recent versions of Rust. This function is now only available as a method of the FromStr
trait.
The modern way to parse values is the .parse
method of str
:
extern crate num;
use num::bigint::BigInt;
fn main() {
match "1".parse::<BigInt>() {
Ok(n) => println!("{}", n),
Err(_) => println!("Error")
}
}