Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Uses 'storage for lifetime in StoredAccountMeta (#32440)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Jul 10, 2023
1 parent 48ac48e commit 65e90ab
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions runtime/src/account_storage/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@ impl<'a: 'b, 'b, T: ReadableAccount + Sync + 'b, U: StorableAccounts<'a, T>, V:
/// References to account data stored elsewhere. Getting an `Account` requires cloning
/// (see `StoredAccountMeta::clone_account()`).
#[derive(PartialEq, Eq, Debug)]
pub enum StoredAccountMeta<'a> {
AppendVec(AppendVecStoredAccountMeta<'a>),
pub enum StoredAccountMeta<'storage> {
AppendVec(AppendVecStoredAccountMeta<'storage>),
}

impl<'a> StoredAccountMeta<'a> {
pub fn pubkey(&self) -> &'a Pubkey {
impl<'storage> StoredAccountMeta<'storage> {
pub fn pubkey(&self) -> &'storage Pubkey {
match self {
Self::AppendVec(av) => av.pubkey(),
}
}

pub fn hash(&self) -> &'a Hash {
pub fn hash(&self) -> &'storage Hash {
match self {
Self::AppendVec(av) => av.hash(),
}
Expand All @@ -127,7 +127,7 @@ impl<'a> StoredAccountMeta<'a> {
}
}

pub fn data(&self) -> &'a [u8] {
pub fn data(&self) -> &'storage [u8] {
match self {
Self::AppendVec(av) => av.data(),
}
Expand All @@ -151,7 +151,7 @@ impl<'a> StoredAccountMeta<'a> {
}
}

pub fn set_meta(&mut self, meta: &'a StoredMeta) {
pub fn set_meta(&mut self, meta: &'storage StoredMeta) {
match self {
Self::AppendVec(av) => av.set_meta(meta),
}
Expand All @@ -164,7 +164,7 @@ impl<'a> StoredAccountMeta<'a> {
}
}

impl<'a> ReadableAccount for StoredAccountMeta<'a> {
impl<'storage> ReadableAccount for StoredAccountMeta<'storage> {
fn lamports(&self) -> u64 {
match self {
Self::AppendVec(av) => av.lamports(),
Expand Down

0 comments on commit 65e90ab

Please sign in to comment.