Skip to content

Commit

Permalink
Use CFIndex::MAX rather than CFIndex::max_value() (#699)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
waywardmonkeys authored Aug 12, 2024
1 parent 9d6b641 commit 84b8365
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core-foundation/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 84b8365

Please sign in to comment.