diff --git a/Rust/src/main.rs b/Rust/src/main.rs
@@ -63,7 +63,7 @@ fn get_countrexpl(max: usize, n_threads: usize) -> Option<(usize, usize)> {
let thread_range = (i..max).step_by(n_threads);
let thread_sums = sums_cache.clone();
- let child = thread::spawn(move || thread_countr_sd.send(get_range_countrexpl(thread_range, thread_sums, max))
+ let child = thread::spawn(move || thread_countr_sd.send(get_iter_countrexpl(thread_range, thread_sums, max))
.expect(&format!("Thread n°{} was unable to sent a message trought the channel", i)));
child_threads.push(child);
@@ -78,17 +78,17 @@ fn get_countrexpl(max: usize, n_threads: usize) -> Option<(usize, usize)> {
None
} else {
- get_range_countrexpl(0..max, sums_cache, max)
+ get_iter_countrexpl(0..max, sums_cache, max)
}
}
/// Search for counterexamples among the items of a specif iterator.
-fn get_range_countrexpl<T: IntoIterator<Item = usize>>(
- range: T,
+fn get_iter_countrexpl<I: IntoIterator<Item = usize>>(
+ iter: I,
sums_cache: Arc<Vec<isize>>,
max: usize
) -> Option<(usize, usize)> {
- for a in range {
+ for a in iter {
for b in a..max {
let diff = sums_cache[a + b] - sums_cache[a] - sums_cache[b];