Skip to content

Commit 6e0e22a

Browse files
i32 -> isize (#29)
* i32 -> isize * fix clippy
1 parent e4a7e2d commit 6e0e22a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/numbers/primes_factorize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ fn main() {
2828
}
2929

3030
let mut lcm = 1;
31-
for i in 2i32..1001 {
32-
lcm *= i.pow(lcm_exps[i as usize]);
31+
for (i, &lcm_exp) in lcm_exps.iter().enumerate().skip(2) {
32+
lcm *= i.pow(lcm_exp);
3333
}
3434

3535
println!("{}", lcm);

src/data_structures/dsu.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/// assert_eq!(dsu.leader(5), 5);
1616
/// ```
1717
pub struct DSU {
18-
e: Vec<i32>,
18+
e: Vec<isize>,
1919
}
2020

2121
impl DSU {
@@ -39,7 +39,7 @@ impl DSU {
3939
} else {
4040
let p = self.e[x] as usize;
4141
let r = self.leader(p);
42-
self.e[x] = r as i32;
42+
self.e[x] = r as isize;
4343
r
4444
}
4545
}
@@ -70,7 +70,7 @@ impl DSU {
7070
std::mem::swap(&mut x, &mut y);
7171
}
7272
self.e[x] += self.e[y];
73-
self.e[y] = x as i32;
73+
self.e[y] = x as isize;
7474
true
7575
}
7676
}

0 commit comments

Comments
 (0)