forked from mirror/grapevine
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)
|
||||
};
|
||||
if use_width {
|
||||
if intermediate <= u64::from(::std::u32::MAX) {
|
||||
(width, intermediate.try_into().unwrap_or(u32::MAX))
|
||||
if let Ok(intermediate) = u32::try_from(intermediate) {
|
||||
(width, intermediate)
|
||||
} else {
|
||||
(
|
||||
(u64::from(width) * u64::from(::std::u32::MAX)
|
||||
|
@ -182,8 +182,8 @@ impl Service {
|
|||
::std::u32::MAX,
|
||||
)
|
||||
}
|
||||
} else if intermediate <= u64::from(::std::u32::MAX) {
|
||||
(intermediate.try_into().unwrap_or(u32::MAX), height)
|
||||
} else if let Ok(intermediate) = u32::try_from(intermediate) {
|
||||
(intermediate, height)
|
||||
} else {
|
||||
(
|
||||
::std::u32::MAX,
|
||||
|
|
Loading…
Reference in a new issue