Skip to content

spl: small opt fn set_authority#3675

Merged
jacobcreech merged 1 commit intosolana-foundation:masterfrom
nkysg:clean_spl
Jul 8, 2025
Merged

spl: small opt fn set_authority#3675
jacobcreech merged 1 commit intosolana-foundation:masterfrom
nkysg:clean_spl

Conversation

@nkysg
Copy link
Copy Markdown
Contributor

@nkysg nkysg commented Apr 20, 2025

Rust’s Option type already supports as_ref for converting Option to Option<&Pubkey>

   pub const fn as_ref(&self) -> Option<&T> {
        match *self {
            Some(ref x) => Some(x),
            None => None,
        }
    }

Add explicit validation of the data length before conversion

pub const fn [from_le_bytes](https://doc.rust-lang.org/std/primitive.u64.html#method.from_le_bytes)(bytes: [[u8](https://doc.rust-lang.org/std/primitive.u8.html); [8](https://doc.rust-lang.org/std/primitive.array.html)]) -> [u64](https://doc.rust-lang.org/std/primitive.u64.html)

@nkysg nkysg changed the title [spl]: small opt fn set_authority and get_account_data_size spl: small opt fn set_authority and get_account_data_size Apr 21, 2025
Copy link
Copy Markdown
Collaborator

@Aursen Aursen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After it seems good to me

Comment thread spl/src/token_2022.rs Outdated
@nkysg nkysg changed the title spl: small opt fn set_authority and get_account_data_size spl: small opt fn set_authority May 20, 2025
@Aursen Aursen added Minor Minor breaking change spl Patch Change that can be done in a patch release and removed Minor Minor breaking change labels May 21, 2025
@jacobcreech jacobcreech merged commit 73fc483 into solana-foundation:master Jul 8, 2025
52 checks passed
@nkysg nkysg deleted the clean_spl branch July 8, 2025 06:48
WilfredAlmeida pushed a commit to KartikSoneji/anchor that referenced this pull request Oct 22, 2025
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Patch Change that can be done in a patch release spl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants