Skip to content

Commit 868bec9

Browse files
committed
refactor(clippy): avoid unnecessary vec conversion
1 parent 711932c commit 868bec9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

node/src/actors/inventory_manager/handlers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl InventoryManager {
140140
// staking/unstaking merkle roots
141141
let fix = |bytes: Vec<u8>| {
142142
if bytes[260..264] == [0x51, 0x00, 0x00, 0x00] {
143-
[&bytes[..260], &vec![0u8; 72], &bytes[260..], &vec![0u8; 16]].concat()
143+
[&bytes[..260], &[0u8; 72], &bytes[260..], &[0u8; 16]].concat()
144144
} else {
145145
bytes
146146
}

wallet/src/repository/wallet/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ where
317317
u64::try_from(get_timestamp()).expect("Get timestamp should return a positive value");
318318
let v2_balance_fix = |bytes: &[u8]| {
319319
if bytes.len() == 16 {
320-
[&bytes[..], &vec![0u8; 8]].concat()
320+
[bytes, &[0u8; 8]].concat()
321321
} else {
322322
Vec::from(bytes)
323323
}

0 commit comments

Comments
 (0)