fix unnecessary cast lint (#2596)

* fix clippy lints on Windows

* fix lints on other platforms

* a couple more

* again

* don't know what's goging on anymore

* fix examples

* comon

* how about now?

* this is getting annoying

* hmmm

* explicitly set a type

* 😢

* don't cast on x64 targets

* apply code review requests

* fix attributes on expressions

* fix ios
This commit is contained in:
Amr Bashir 2022-12-22 21:35:33 +02:00 committed by GitHub
parent da7422c6e1
commit 402cbd55f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 63 additions and 64 deletions

View file

@ -129,12 +129,12 @@ impl FrameExtentsHeuristic {
width.saturating_add(
self.frame_extents
.left
.saturating_add(self.frame_extents.right) as u32,
.saturating_add(self.frame_extents.right) as _,
),
height.saturating_add(
self.frame_extents
.top
.saturating_add(self.frame_extents.bottom) as u32,
.saturating_add(self.frame_extents.bottom) as _,
),
)
}

View file

@ -198,7 +198,7 @@ impl<'a> NormalHints<'a> {
pub fn get_position(&self) -> Option<(i32, i32)> {
has_flag(self.size_hints.flags, ffi::PPosition)
.then(|| (self.size_hints.x as i32, self.size_hints.y as i32))
.then(|| (self.size_hints.x, self.size_hints.y))
}
pub fn get_resize_increments(&self) -> Option<(u32, u32)> {

View file

@ -126,11 +126,8 @@ impl XConnection {
let scale_factor = match dpi_env {
EnvVarDPI::Randr => calc_dpi_factor(
((*crtc).width as u32, (*crtc).height as u32),
(
(*output_info).mm_width as u64,
(*output_info).mm_height as u64,
),
((*crtc).width, (*crtc).height),
((*output_info).mm_width as _, (*output_info).mm_height as _),
),
EnvVarDPI::Scale(dpi_override) => {
if !validate_scale_factor(dpi_override) {
@ -146,11 +143,8 @@ impl XConnection {
dpi / 96.
} else {
calc_dpi_factor(
((*crtc).width as u32, (*crtc).height as u32),
(
(*output_info).mm_width as u64,
(*output_info).mm_height as u64,
),
((*crtc).width, (*crtc).height),
((*output_info).mm_width as _, (*output_info).mm_height as _),
)
}
}