mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-01 14:20:05 -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:
@@ -9,6 +9,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
|||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
- Bump MSRV from `1.60` to `1.64`.
|
- Bump MSRV from `1.60` to `1.64`.
|
||||||
|
- On macOS, fixed potential panic when getting refresh rate.
|
||||||
|
|
||||||
# 0.28.3
|
# 0.28.3
|
||||||
|
|
||||||
|
|||||||
@@ -230,7 +230,9 @@ impl MonitorHandle {
|
|||||||
return None;
|
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