Skip to content

Commit 4e57e4d

Browse files
authored
Merge pull request #5986 from obycode/chore/clippy-updates
chore: fixes for latest clippy checks
2 parents 3a434da + 24b5c4e commit 4e57e4d

File tree

6 files changed

+15
-18
lines changed

6 files changed

+15
-18
lines changed

pox-locking/src/pox_2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ pub fn parse_pox_increase(result: &Value) -> std::result::Result<(PrincipalData,
173173
///
174174
/// # Errors
175175
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
176-
/// which isn't locked. This *should* have been checked by the PoX v2 contract,
177-
/// so this should surface in a panic.
176+
/// which isn't locked. This *should* have been checked by the PoX v2 contract,
177+
/// so this should surface in a panic.
178178
pub fn pox_lock_increase_v2(
179179
db: &mut ClarityDatabase,
180180
principal: &PrincipalData,
@@ -226,8 +226,8 @@ pub fn pox_lock_increase_v2(
226226
///
227227
/// # Errors
228228
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
229-
/// which isn't locked. This *should* have been checked by the PoX v2 contract,
230-
/// so this should surface in a panic.
229+
/// which isn't locked. This *should* have been checked by the PoX v2 contract,
230+
/// so this should surface in a panic.
231231
pub fn pox_lock_extend_v2(
232232
db: &mut ClarityDatabase,
233233
principal: &PrincipalData,

pox-locking/src/pox_3.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ pub fn pox_lock_v3(
9696
///
9797
/// # Errors
9898
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
99-
/// which isn't locked. This *should* have been checked by the PoX v3 contract,
100-
/// so this should surface in a panic.
99+
/// which isn't locked. This *should* have been checked by the PoX v3 contract,
100+
/// so this should surface in a panic.
101101
pub fn pox_lock_extend_v3(
102102
db: &mut ClarityDatabase,
103103
principal: &PrincipalData,
@@ -132,8 +132,8 @@ pub fn pox_lock_extend_v3(
132132
///
133133
/// # Errors
134134
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
135-
/// which isn't locked. This *should* have been checked by the PoX v3 contract,
136-
/// so this should surface in a panic.
135+
/// which isn't locked. This *should* have been checked by the PoX v3 contract,
136+
/// so this should surface in a panic.
137137
pub fn pox_lock_increase_v3(
138138
db: &mut ClarityDatabase,
139139
principal: &PrincipalData,

pox-locking/src/pox_4.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ pub fn pox_lock_v4(
6969
///
7070
/// # Errors
7171
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
72-
/// which isn't locked. This *should* have been checked by the PoX v4 contract,
73-
/// so this should surface in a panic.
72+
/// which isn't locked. This *should* have been checked by the PoX v4 contract,
73+
/// so this should surface in a panic.
7474
pub fn pox_lock_extend_v4(
7575
db: &mut ClarityDatabase,
7676
principal: &PrincipalData,
@@ -105,8 +105,8 @@ pub fn pox_lock_extend_v4(
105105
///
106106
/// # Errors
107107
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
108-
/// which isn't locked. This *should* have been checked by the PoX v4 contract,
109-
/// so this should surface in a panic.
108+
/// which isn't locked. This *should* have been checked by the PoX v4 contract,
109+
/// so this should surface in a panic.
110110
pub fn pox_lock_increase_v4(
111111
db: &mut ClarityDatabase,
112112
principal: &PrincipalData,

stacks-common/src/deps_common/bitcoin/blockdata/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl BlockHeader {
101101

102102
/// Computes the target value in float format from Uint256 format.
103103
pub fn compact_target_from_u256(value: &Uint256) -> u32 {
104-
let mut size = (value.bits() + 7) / 8;
104+
let mut size = value.bits().div_ceil(8);
105105
let mut compact = if size <= 3 {
106106
(value.low_u64() << (8 * (3 - size))) as u32
107107
} else {

stacks-common/src/deps_common/bitcoin/util/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ pub fn bitcoin_merkle_root(data: Vec<Sha256dHash>) -> Sha256dHash {
436436
return data[0];
437437
}
438438
// Recursion
439-
let iterations = (data.len() + 1) / 2;
439+
let iterations = data.len().div_ceil(2);
440440
let mut next = Vec::with_capacity(iterations);
441441
for idx in 0..iterations {
442442
let idx1 = 2 * idx;

stacks-common/src/util/secp256k1/native.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ impl MessageSignature {
9494
let mut sig_bytes = [0u8; 64];
9595
sig_bytes[..64].copy_from_slice(&self.0[1..=64]);
9696

97-
match LibSecp256k1RecoverableSignature::from_compact(&sig_bytes, recid) {
98-
Ok(sig) => Some(sig),
99-
Err(_) => None,
100-
}
97+
LibSecp256k1RecoverableSignature::from_compact(&sig_bytes, recid).ok()
10198
}
10299

103100
/// Convert from VRS to RSV

0 commit comments

Comments
 (0)