Skip to content

spl: small opt fn set_authority #3675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2025

Conversation

nkysg
Copy link
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
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

@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
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