mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-18 15:28:10 +00:00
genpolicy: Fix clippy manual_div_ceil
Manually fix `manual_div_ceil` clippy warning reported by rust 1.85.1. ```console error: manually reimplementing `div_ceil` --> src/verity.rs:73:25 | 73 | let count = (data_size + entry_size - 1) / entry_size; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `data_size.div_ceil(entry_size)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil = note: `-D clippy::manual-div-ceil` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::manual_div_ceil)]` ``` Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
@@ -70,7 +70,7 @@ impl<T: Digest + Clone> Verity<T> {
|
||||
for (i, l) in levels.iter_mut().enumerate() {
|
||||
let entry_size = (data_block_size as u64)
|
||||
* ((hash_block_size / Self::HASH_SIZE) as u64).pow(level_count as u32 - i as u32);
|
||||
let count = (data_size + entry_size - 1) / entry_size;
|
||||
let count = data_size.div_ceil(entry_size);
|
||||
l.file_offset = write_file_offset;
|
||||
write_file_offset += hash_block_size as u64 * count;
|
||||
}
|
||||
|
Reference in New Issue
Block a user