Skip to content

Commit a0eb195

Browse files
authored
Merge pull request #26 from LebedevRI/clippy
Cargo: `manual_is_multiple_of`
2 parents 136f722 + 31ac38e commit a0eb195

File tree

2 files changed

+3
-3
lines changed
  • src/memory

2 files changed

+3
-3
lines changed

src/memory/bitstreamer/bitstreamer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ where
195195
fn fill_cache_impl(&mut self, input: T::MaxProcessByteArray) -> usize {
196196
let stream_chunk_bitwidth: usize = T::ChunkType::BITWIDTH;
197197
assert!(stream_chunk_bitwidth >= 1);
198-
assert!(stream_chunk_bitwidth % 8 == 0);
198+
assert!(stream_chunk_bitwidth.is_multiple_of(8));
199199

200200
assert!(8 * T::MAX_PROCESS_BYTES >= stream_chunk_bitwidth);
201-
assert!(8 * T::MAX_PROCESS_BYTES % stream_chunk_bitwidth == 0);
201+
assert!((8 * T::MAX_PROCESS_BYTES).is_multiple_of(stream_chunk_bitwidth));
202202

203203
let num_chunks_needed =
204204
(8 * T::MAX_PROCESS_BYTES) / stream_chunk_bitwidth;

src/memory/bitvacuumer/bitvacuumer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ where
5656
let stream_chunk_bitwidth: usize = T::ChunkType::BITWIDTH;
5757

5858
assert!(WritebackCache::BITWIDTH >= stream_chunk_bitwidth);
59-
assert!(WritebackCache::BITWIDTH % stream_chunk_bitwidth == 0);
59+
assert!(WritebackCache::BITWIDTH.is_multiple_of(stream_chunk_bitwidth));
6060
let num_chunks_needed: usize =
6161
WritebackCache::BITWIDTH / stream_chunk_bitwidth;
6262
assert!(num_chunks_needed >= 1);

0 commit comments

Comments
 (0)