Skip to content

Commit 7220327

Browse files
authored
epoch-stake: Make the crate no_std (anza-xyz#422)
Use `core::ptr` instead of `std::ptr` and mark the crate as `no_std`.
1 parent 162fdd1 commit 7220327

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

epoch-stake/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! current epoch or the stake for a specific vote account using the
55
//! `sol_get_epoch_stake` syscall.
66
#![cfg_attr(docsrs, feature(doc_cfg))]
7+
#![no_std]
78

89
use solana_pubkey::Pubkey;
910

@@ -22,7 +23,7 @@ fn get_epoch_stake(var_addr: *const u8) -> u64 {
2223

2324
/// Get the current epoch's total stake.
2425
pub fn get_epoch_total_stake() -> u64 {
25-
get_epoch_stake(std::ptr::null::<Pubkey>() as *const u8)
26+
get_epoch_stake(core::ptr::null::<Pubkey>() as *const u8)
2627
}
2728

2829
/// Get the current epoch stake for a given vote address.

scripts/check-no-std.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ no_std_crates=(
1717
-p solana-epoch-info
1818
-p solana-epoch-rewards
1919
-p solana-epoch-schedule
20+
-p solana-epoch-stake
2021
-p solana-fee-calculator
2122
-p solana-hash
2223
-p solana-keccak-hasher

0 commit comments

Comments
 (0)