chore: satisfy clippy::manual_div_ceil

This only fires with Rust 1.83 or newer, but we can preempt this case
with our current MSRV.
This commit is contained in:
Erich Gubler 2024-11-24 15:05:22 -05:00
parent 3032e9a43c
commit 13a533022e
2 changed files with 3 additions and 4 deletions

View File

@ -783,8 +783,7 @@ impl super::Queue {
.buffer_layout
.bytes_per_row
.unwrap_or(copy.size.width * block_size);
let minimum_rows_per_image =
(copy.size.height + block_height - 1) / block_height;
let minimum_rows_per_image = copy.size.height.div_ceil(block_height);
let rows_per_image = copy
.buffer_layout
.rows_per_image

View File

@ -5901,8 +5901,8 @@ impl Extent3d {
pub fn physical_size(&self, format: TextureFormat) -> Self {
let (block_width, block_height) = format.block_dimensions();
let width = ((self.width + block_width - 1) / block_width) * block_width;
let height = ((self.height + block_height - 1) / block_height) * block_height;
let width = self.width.div_ceil(block_width) * block_width;
let height = self.height.div_ceil(block_height) * block_height;
Self {
width,