mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
Fix weird type gymnastics
This commit is contained in:
parent
5c4062742f
commit
74589043f7
1 changed files with 4 additions and 4 deletions
|
|
@ -171,8 +171,8 @@ impl Service {
|
||||||
/ u64::from(original_height)
|
/ u64::from(original_height)
|
||||||
};
|
};
|
||||||
if use_width {
|
if use_width {
|
||||||
if intermediate <= u64::from(::std::u32::MAX) {
|
if let Ok(intermediate) = u32::try_from(intermediate) {
|
||||||
(width, intermediate.try_into().unwrap_or(u32::MAX))
|
(width, intermediate)
|
||||||
} else {
|
} else {
|
||||||
(
|
(
|
||||||
(u64::from(width) * u64::from(::std::u32::MAX)
|
(u64::from(width) * u64::from(::std::u32::MAX)
|
||||||
|
|
@ -182,8 +182,8 @@ impl Service {
|
||||||
::std::u32::MAX,
|
::std::u32::MAX,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else if intermediate <= u64::from(::std::u32::MAX) {
|
} else if let Ok(intermediate) = u32::try_from(intermediate) {
|
||||||
(intermediate.try_into().unwrap_or(u32::MAX), height)
|
(intermediate, height)
|
||||||
} else {
|
} else {
|
||||||
(
|
(
|
||||||
::std::u32::MAX,
|
::std::u32::MAX,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue