Update to rust 1.85 (#35628)

* Update to rust 1.85

This is needed for cargo-deny

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Upgrade crown

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Clippy fixes

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Re-upgrade cargo-deny to 0.18

Keeping it locked to 0.18 just in case they
update their required rustc version again

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-02-24 18:44:35 +01:00 committed by GitHub
parent d78f7b2d78
commit be6765447d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 88 additions and 105 deletions

View file

@ -216,10 +216,7 @@ impl PathBuilderRef<'_> {
}
fn current_point(&mut self) -> Option<Point2D<f32>> {
let inverse = match self.transform.inverse() {
Some(i) => i,
None => return None,
};
let inverse = self.transform.inverse()?;
self.builder
.get_current_point()
.map(|point| inverse.transform_point(Point2D::new(point.x, point.y)))
@ -1404,7 +1401,7 @@ impl<'a> CanvasData<'a> {
let canvas_rect = Rect::from_size(canvas_size);
if canvas_rect
.intersection(&read_rect)
.map_or(true, |rect| rect.is_empty())
.is_none_or(|rect| rect.is_empty())
{
return vec![];
}

View file

@ -2881,10 +2881,10 @@ fn image_to_tex_image_data(
for i in 0..pixel_count {
let p = {
let rgba = &pixels[i * 4..i * 4 + 4];
(rgba[0] as u16 & 0xf0) << 8 |
(rgba[1] as u16 & 0xf0) << 4 |
((rgba[0] as u16 & 0xf0) << 8) |
((rgba[1] as u16 & 0xf0) << 4) |
(rgba[2] as u16 & 0xf0) |
(rgba[3] as u16 & 0xf0) >> 4
((rgba[3] as u16 & 0xf0) >> 4)
};
NativeEndian::write_u16(&mut pixels[i * 2..i * 2 + 2], p);
}
@ -2895,10 +2895,10 @@ fn image_to_tex_image_data(
for i in 0..pixel_count {
let p = {
let rgba = &pixels[i * 4..i * 4 + 4];
(rgba[0] as u16 & 0xf8) << 8 |
(rgba[1] as u16 & 0xf8) << 3 |
(rgba[2] as u16 & 0xf8) >> 2 |
(rgba[3] as u16) >> 7
((rgba[0] as u16 & 0xf8) << 8) |
((rgba[1] as u16 & 0xf8) << 3) |
((rgba[2] as u16 & 0xf8) >> 2) |
((rgba[3] as u16) >> 7)
};
NativeEndian::write_u16(&mut pixels[i * 2..i * 2 + 2], p);
}
@ -2909,9 +2909,9 @@ fn image_to_tex_image_data(
for i in 0..pixel_count {
let p = {
let rgb = &pixels[i * 4..i * 4 + 3];
(rgb[0] as u16 & 0xf8) << 8 |
(rgb[1] as u16 & 0xfc) << 3 |
(rgb[2] as u16 & 0xf8) >> 3
((rgb[0] as u16 & 0xf8) << 8) |
((rgb[1] as u16 & 0xfc) << 3) |
((rgb[2] as u16 & 0xf8) >> 3)
};
NativeEndian::write_u16(&mut pixels[i * 2..i * 2 + 2], p);
}
@ -3057,15 +3057,15 @@ fn premultiply_inplace(format: TexFormat, data_type: TexDataType, pixels: &mut [
(TexFormat::RGBA, TexDataType::UnsignedShort4444) => {
for rgba in pixels.chunks_mut(2) {
let pix = NativeEndian::read_u16(rgba);
let extend_to_8_bits = |val| (val | val << 4) as u8;
let r = extend_to_8_bits(pix >> 12 & 0x0f);
let g = extend_to_8_bits(pix >> 8 & 0x0f);
let b = extend_to_8_bits(pix >> 4 & 0x0f);
let extend_to_8_bits = |val| (val | (val << 4)) as u8;
let r = extend_to_8_bits((pix >> 12) & 0x0f);
let g = extend_to_8_bits((pix >> 8) & 0x0f);
let b = extend_to_8_bits((pix >> 4) & 0x0f);
let a = extend_to_8_bits(pix & 0x0f);
NativeEndian::write_u16(
rgba,
((pixels::multiply_u8_color(r, a) & 0xf0) as u16) << 8 |
((pixels::multiply_u8_color(g, a) & 0xf0) as u16) << 4 |
(((pixels::multiply_u8_color(r, a) & 0xf0) as u16) << 8) |
(((pixels::multiply_u8_color(g, a) & 0xf0) as u16) << 4) |
((pixels::multiply_u8_color(b, a) & 0xf0) as u16) |
((a & 0x0f) as u16),
);