Changed to use inclusive range operator (#632)

This commit is contained in:
Christian Vallentin 2021-01-07 17:13:15 +01:00 committed by GitHub
parent 9953362df2
commit 1b9a276ed2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ use num::bigint::{BigInt, ToBigInt};
fn factorial(x: i32) -> BigInt {
if let Some(mut factorial) = 1.to_bigint() {
for i in 1..(x+1) {
for i in 1..=x {
factorial = factorial * i;
}
factorial