Skip to content

Commit 84b8365

Browse files
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.
1 parent 9d6b641 commit 84b8365

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core-foundation/src/base.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ pub trait CFIndexConvertible {
2929
impl CFIndexConvertible for usize {
3030
#[inline]
3131
fn to_CFIndex(self) -> CFIndex {
32-
let max_CFIndex = CFIndex::max_value();
33-
if self > (max_CFIndex as usize) {
32+
if self > (CFIndex::MAX as usize) {
3433
panic!("value out of range")
3534
}
3635
self as CFIndex

0 commit comments

Comments
 (0)