Use CFIndex::MAX rather than CFIndex::max_value() (#699)

Since `CFIndex` is just `isize`, we can use the `CFIndex::MAX`
constant. The `max_value` and other functions are pending
deprecation and cause a clippy lint warning.
This commit is contained in:
Bruce Mitchener
2024-08-12 09:42:23 +07:00
committed by GitHub
parent 9d6b64153d
commit 84b8365425
+1 -2
View File
@@ -29,8 +29,7 @@ pub trait CFIndexConvertible {
impl CFIndexConvertible for usize {
#[inline]
fn to_CFIndex(self) -> CFIndex {
let max_CFIndex = CFIndex::max_value();
if self > (max_CFIndex as usize) {
if self > (CFIndex::MAX as usize) {
panic!("value out of range")
}
self as CFIndex