cargo clippy

This commit is contained in:
Matthieu Baumann
2025-09-24 17:08:32 +02:00
parent 9e8db0379b
commit acef664b45
4 changed files with 4426 additions and 4426 deletions

View File

@@ -98,7 +98,7 @@ fn get_coord_uv_it(
)
.chain(std::iter::once((
xmax,
if xmax % max_tex_size == 0 {
if xmax.is_multiple_of(max_tex_size) {
1.0
} else {
get_uv_in_tex_chunk(xmax)
@@ -129,7 +129,7 @@ fn get_coord_uv_it(
})
.chain(std::iter::once((
xmax,
if xmax % max_tex_size == 0 {
if xmax.is_multiple_of(max_tex_size) {
1.0
} else {
get_uv_in_tex_chunk(xmax)

View File

@@ -88,7 +88,7 @@ where
pixels_written += num_pixels_to_read;
if F::PIXEL_TYPE.num_channels() == 1 && y % step_cut == 0 {
if F::PIXEL_TYPE.num_channels() == 1 && y.is_multiple_of(step_cut) {
// on a good line
let bytes_line = &buf[id_tx][off_bytes_dst..(off_bytes_dst + num_bytes_to_read)];
for x_in_patch in (0..w_patch).step_by(step_cut) {
@@ -153,7 +153,7 @@ where
}
}
if (((dy + 1) % (max_tex_size as usize) == 0) && id_tx == buf.len() - 1)
if ((dy + 1).is_multiple_of(max_tex_size as usize) && id_tx == buf.len() - 1)
|| pixels_written >= num_pixels
{
// we can create new textures of size max_tex_size

File diff suppressed because it is too large Load Diff

View File

@@ -58,7 +58,7 @@ pub unsafe fn transmute_vec_to_u8<I>(mut s: Vec<I>) -> Vec<u8> {
#[allow(dead_code)]
pub unsafe fn transmute_vec<I, O>(mut s: Vec<I>) -> Result<Vec<O>, &'static str> {
if std::mem::size_of::<I>() % std::mem::size_of::<O>() > 0 {
if !std::mem::size_of::<I>().is_multiple_of(std::mem::size_of::<O>()) {
Err("The input type is not a multiple of the output type")
} else {
s.set_len(s.len() * (std::mem::size_of::<I>() / std::mem::size_of::<O>()));