Skip to content

Commit 5e5dd79

Browse files
fix: resolve clippy errors in CI
1 parent 86fdc9e commit 5e5dd79

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

key-wallet-ffi/src/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub unsafe extern "C" fn address_array_free(addresses: *mut *mut c_char, count:
4444
}
4545
}
4646
// Free the array itself
47-
let _ = Box::from_raw(std::slice::from_raw_parts_mut(addresses, count));
47+
let _ = Box::from_raw(std::ptr::slice_from_raw_parts_mut(addresses, count));
4848
}
4949
}
5050
}

key-wallet-ffi/src/address_pool.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -941,14 +941,16 @@ pub unsafe extern "C" fn address_info_free(info: *mut FFIAddressInfo) {
941941

942942
// Free the byte arrays
943943
if !info.script_pubkey.is_null() && info.script_pubkey_len > 0 {
944-
let _ = Box::from_raw(std::slice::from_raw_parts_mut(
944+
let _ = Box::from_raw(std::ptr::slice_from_raw_parts_mut(
945945
info.script_pubkey,
946946
info.script_pubkey_len,
947947
));
948948
}
949949
if !info.public_key.is_null() && info.public_key_len > 0 {
950-
let _ =
951-
Box::from_raw(std::slice::from_raw_parts_mut(info.public_key, info.public_key_len));
950+
let _ = Box::from_raw(std::ptr::slice_from_raw_parts_mut(
951+
info.public_key,
952+
info.public_key_len,
953+
));
952954
}
953955
}
954956
}
@@ -963,7 +965,7 @@ pub unsafe extern "C" fn address_info_free(info: *mut FFIAddressInfo) {
963965
#[no_mangle]
964966
pub unsafe extern "C" fn address_info_array_free(infos: *mut *mut FFIAddressInfo, count: usize) {
965967
if !infos.is_null() && count > 0 {
966-
let array = Box::from_raw(std::slice::from_raw_parts_mut(infos, count));
968+
let array = Box::from_raw(std::ptr::slice_from_raw_parts_mut(infos, count));
967969
for info_ptr in array.iter() {
968970
address_info_free(*info_ptr);
969971
}

key-wallet-ffi/src/keys.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,13 +991,13 @@ pub unsafe extern "C" fn derivation_path_free(
991991
if !indices.is_null() && count > 0 {
992992
unsafe {
993993
// Reconstruct the boxed slice from the raw pointer and let it drop
994-
let _ = Box::from_raw(std::slice::from_raw_parts_mut(indices, count));
994+
let _ = Box::from_raw(std::ptr::slice_from_raw_parts_mut(indices, count));
995995
}
996996
}
997997
if !hardened.is_null() && count > 0 {
998998
unsafe {
999999
// Reconstruct the boxed slice from the raw pointer and let it drop
1000-
let _ = Box::from_raw(std::slice::from_raw_parts_mut(hardened, count));
1000+
let _ = Box::from_raw(std::ptr::slice_from_raw_parts_mut(hardened, count));
10011001
}
10021002
}
10031003
}

0 commit comments

Comments
 (0)