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:
parent
da7422c6e1
commit
402cbd55f9
27 changed files with 63 additions and 64 deletions
14
src/dpi.rs
14
src/dpi.rs
|
|
@ -519,18 +519,8 @@ impl Size {
|
|||
max.into().to_physical::<f64>(scale_factor),
|
||||
);
|
||||
|
||||
let clamp = |input: f64, min: f64, max: f64| {
|
||||
if input < min {
|
||||
min
|
||||
} else if input > max {
|
||||
max
|
||||
} else {
|
||||
input
|
||||
}
|
||||
};
|
||||
|
||||
let width = clamp(input.width, min.width, max.width);
|
||||
let height = clamp(input.height, min.height, max.height);
|
||||
let width = input.width.clamp(min.width, max.width);
|
||||
let height = input.height.clamp(min.height, max.height);
|
||||
|
||||
PhysicalSize::new(width, height).into()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue