I would like to loop through a range of values that have a BigUint
type (from the num
crate).
How can I do this?
I tried
for i in 0..a {...}
where a
is a (borrowed) BigUint
type. I got a error about mismatched integer types so I tried this instead:
for i in Zero::zero()..a {...}
But I get different errors depending on if a
is borrowed or not.
If a
is borrowed then I get this in the errors:
| for i in Zero::zero()..(a) {
| ^^^^^^^^^^ the trait `num::Zero` is not implemented for `&num::BigUint`
If a is not borrowed, then this is the error:
| for i in Zero::zero()..(a) {
| ^^^^^^^^^^^^^^^^^ the trait `std::iter::Step` is not implemented for `num::BigUint`