mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-09 21:01:29 +11: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:
parent
fbea75d31f
commit
2486f0f1a1
|
@ -9,6 +9,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
|||
# Unreleased
|
||||
|
||||
- Bump MSRV from `1.60` to `1.64`.
|
||||
- On macOS, fixed potential panic when getting refresh rate.
|
||||
|
||||
# 0.28.3
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue