Skip to content

Commit

Permalink
Don't use core::i32::MAX
Browse files Browse the repository at this point in the history
This is a legacy constant and it's better to just use `i32::MAX`. Note
that one cannot `use` an associated constant so this just removed the
import. This is better anyway since it's only used once and it didn't
provide meaningful line length reduction.
  • Loading branch information
Kixunil committed Sep 6, 2024
1 parent 05c5937 commit 7ad2f2e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,10 +638,9 @@ impl PublicKey {
/// # }
/// ```
pub fn combine_keys(keys: &[&PublicKey]) -> Result<PublicKey, Error> {
use core::i32::MAX;
use core::mem::transmute;

if keys.is_empty() || keys.len() > MAX as usize {
if keys.is_empty() || keys.len() > i32::MAX as usize {
return Err(InvalidPublicKeySum);
}

Expand Down

0 comments on commit 7ad2f2e

Please sign in to comment.