mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Fix potential panic (#2755)
* Fix potential panic * Update CHANGELOG.md * Use checked_div --------- Co-authored-by: Xiaopeng Li <lixiaopeng.jetspark@bytedance.com>
This commit is contained in:
committed by
Kirill Chibisov
parent
64a97c16c7
commit
d37dac8f39
@@ -230,7 +230,9 @@ impl MonitorHandle {
|
||||
return None;
|
||||
}
|
||||
|
||||
Some((time.time_scale as i64 / time.time_value * 1000) as u32)
|
||||
(time.time_scale as i64)
|
||||
.checked_div(time.time_value)
|
||||
.map(|v| (v * 1000) as u32)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user