|
1 |
| -#![allow(unused)] |
2 |
| - |
3 | 1 | //! Implements a map from integer indices to data.
|
4 | 2 | //! Rather than storing data for every index, internally, this maps entire ranges to the data.
|
5 | 3 | //! To this end, the APIs all work on ranges, not on individual integers. Ranges are split as
|
|
8 | 6 | //! via the iteration APIs.
|
9 | 7 |
|
10 | 8 | use std::ops;
|
11 |
| -use std::num::NonZeroU64; |
12 | 9 |
|
13 | 10 | use rustc::ty::layout::Size;
|
14 | 11 |
|
@@ -158,7 +155,7 @@ impl<T> RangeMap<T> {
|
158 | 155 | let mut end_idx = first_idx; // when the loop is done, this is the first excluded element.
|
159 | 156 | loop {
|
160 | 157 | // Compute if `end` is the last element we need to look at.
|
161 |
| - let done = (self.v[end_idx].range.end >= offset+len); |
| 158 | + let done = self.v[end_idx].range.end >= offset+len; |
162 | 159 | // We definitely need to include `end`, so move the index.
|
163 | 160 | end_idx += 1;
|
164 | 161 | debug_assert!(done || end_idx < self.v.len(), "iter_mut: end-offset {} is out-of-bounds", offset+len);
|
@@ -284,7 +281,7 @@ mod tests {
|
284 | 281 | .map(|&t| t).collect::<Vec<_>>(), vec![19, 19]);
|
285 | 282 |
|
286 | 283 | // A NOP `iter_mut` should trigger merging.
|
287 |
| - for x in map.iter_mut(Size::from_bytes(15), Size::from_bytes(5)) { } |
| 284 | + for _ in map.iter_mut(Size::from_bytes(15), Size::from_bytes(5)) { } |
288 | 285 | assert_eq!(map.v.len(), 5);
|
289 | 286 | assert_eq!(
|
290 | 287 | to_vec(&map, 10, 10),
|
|
0 commit comments