Skip to content

Commit

Permalink
DOSE-661 Follow On
Browse files Browse the repository at this point in the history
Side-Fix:
* Add clippy for tests in `make rustclippy` target
  • Loading branch information
sdimitro committed Sep 27, 2021
1 parent ab26732 commit 7c42d49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ rustclippy: $(RUSTDIRS)
set -e ; \
for dir in $(RUSTDIRS) ; do \
cargo clippy --workspace --manifest-path $$dir/Cargo.toml -- -Dwarnings ; \
cargo clippy --tests --workspace --manifest-path $$dir/Cargo.toml -- -Dwarnings ; \
done \
else \
echo "skipping rustclippy because cargo-clippy is not installed"; \
Expand Down
4 changes: 2 additions & 2 deletions cmd/zfs_object_agent/zettacache/src/bitmap_range_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ mod tests {
fn test_start_range_end_range() {
let mut a = RoaringBitmap::new();
a.insert_range(0..2);
a.insert_range(10..2);
a.insert_range(10..12);
validate_iter_ranges(&a);
}

Expand Down Expand Up @@ -192,7 +192,7 @@ mod tests {
fn test_middle_range_end_range() {
let mut a = RoaringBitmap::new();
a.insert_range(5..7);
a.insert_range(10..2);
a.insert_range(10..12);
validate_iter_ranges(&a);
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/zfs_object_agent/zettacache/src/block_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ impl SlabTrait for BitmapSlab {
for slot in self.allocatable.iter() {
let slot_offset = self.to_offset(slot);
spacemap.alloc(alloc_offset, slot_offset - alloc_offset);
alloc_offset = slot_offset + u64::from(self.slot_size);
written_segments += (slot_offset - alloc_offset) / u64::from(self.slot_size);
alloc_offset = slot_offset + u64::from(self.slot_size);
}
spacemap.alloc(alloc_offset, self.end_offset() - alloc_offset);
written_segments += (self.end_offset() - alloc_offset) / u64::from(self.slot_size);
Expand Down

0 comments on commit 7c42d49

Please sign in to comment.