Skip to content

Commit 4d1e3f5

Browse files
fix(dash): resolve clippy manual_is_multiple_of warnings in special transactions
Replace manual modulo checks with is_multiple_of() method in hex_decode functions: - coinbase.rs: Check for odd-length hex strings - mnhf_signal.rs: Check for odd-length hex strings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5d7f410 commit 4d1e3f5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dash/src/blockdata/transaction/special_transaction/coinbase.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ mod tests {
249249
}
250250

251251
fn hex_decode(s: &str) -> Result<Vec<u8>, &'static str> {
252-
if s.len() % 2 != 0 {
252+
if !s.len().is_multiple_of(2) {
253253
return Err("Hex string has odd length");
254254
}
255255

dash/src/blockdata/transaction/special_transaction/mnhf_signal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ mod tests {
154154
}
155155

156156
fn hex_decode(s: &str) -> Result<Vec<u8>, &'static str> {
157-
if s.len() % 2 != 0 {
157+
if !s.len().is_multiple_of(2) {
158158
return Err("Hex string has odd length");
159159
}
160160

0 commit comments

Comments
 (0)