Rust “不稳定库功能”的解决方法是什么;核心;问题
我试图在Rust中将大整数相加:Rust “不稳定库功能”的解决方法是什么;核心;问题,rust,biginteger,Rust,Biginteger,我试图在Rust中将大整数相加: extern crate core; use core::ops::Add; use num::bigint::{BigInt}; use num::integer::Integer; ... let mut big = "8705702225074732811211966512111".parse::<BigInt>().unwrap(); let one = "1".parse::<BigInt>().unwrap(); big =
extern crate core;
use core::ops::Add;
use num::bigint::{BigInt};
use num::integer::Integer;
...
let mut big = "8705702225074732811211966512111".parse::<BigInt>().unwrap();
let one = "1".parse::<BigInt>().unwrap();
big = big.add(&one);
现在有什么解决办法吗?或者这在目前是完全不可行的?您应该能够使用trait而不是
core::ops::Add
use std::ops::Add;
谢谢成功了。尽管很奇怪。。。有没有一种方法可以仅仅根据文档而不是在论坛上提问来找出这个答案呢?他们说
不建议使用核心库。libcore的稳定功能是从标准库中重新导出的。
,并提供指向文档的链接。
use std::ops::Add;