Skip to content

Commit 5674bd8

Browse files
committed
Fix lint
1 parent 33c42e3 commit 5674bd8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

sdk/pinocchio/src/account_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub(crate) struct Account {
6363
/// - `7 6 5 4 3 2 1 0`
6464
/// - `. x x x . . . .`: number of immutable borrows that can still be
6565
/// allocated, for the lamports field. Ranges from 7 (`111`) to
66-
/// 0 (`000`).
66+
/// 0 (`000`).
6767
///
6868
/// * data mutable borrow flag
6969
/// - `7 6 5 4 3 2 1 0`

sdk/pinocchio/src/entrypoint/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ macro_rules! align_pointer {
197197
($ptr:ident) => {
198198
// integer-to-pointer cast: the resulting pointer will have the same provenance as
199199
// the original pointer and it follows the alignment requirement for the input.
200-
(($ptr as usize + (BPF_ALIGN_OF_U128 - 1)) & !(BPF_ALIGN_OF_U128 - 1)) as *mut u8
200+
$ptr.with_addr((($ptr.addr() + (BPF_ALIGN_OF_U128 - 1)) & !(BPF_ALIGN_OF_U128 - 1)))
201201
};
202202
}
203203

sdk/pinocchio/src/sysvars/slot_hashes/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ fn test_from_account_info_constructor() {
416416
unsafe {
417417
let header_size = core::mem::size_of::<AccountLayout>();
418418
let total_size = header_size + data.len();
419-
let word_len = (total_size + 7) / 8;
419+
let word_len = total_size.div_ceil(8);
420420
aligned_backing = std::vec![0u64; word_len];
421421
let base_ptr = aligned_backing.as_mut_ptr() as *mut u8;
422422

sdk/pinocchio/src/sysvars/slot_hashes/test_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub unsafe fn make_account_info(
123123
) -> (AccountInfo, Vec<u64>) {
124124
let hdr_size = mem::size_of::<AccountLayout>();
125125
let total = hdr_size + data.len();
126-
let words = (total + 7) / 8;
126+
let words = total.div_ceil(8);
127127
let mut backing: Vec<u64> = std::vec![0u64; words];
128128
assert!(
129129
mem::align_of::<u64>() >= mem::align_of::<AccountLayout>(),

0 commit comments

Comments
 (0)