Skip to content

Commit

Permalink
fix(wallet)!: Have proper lifetime bounds for AsyncWalletPersister
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlinjin committed Aug 14, 2024
1 parent 512d945 commit 8498a5f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/wallet/src/wallet/persisted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,22 @@ pub trait AsyncWalletPersister {
type Error;

/// Initialize the persister.
fn initialize(persister: &mut Self) -> FutureResult<(), Self::Error>;
fn initialize<'a>(persister: &'a mut Self) -> FutureResult<'a, (), Self::Error>
where
Self: 'a;

/// Persist changes.
fn persist<'a>(
persister: &'a mut Self,
changeset: &'a ChangeSet,
) -> FutureResult<'a, (), Self::Error>;
) -> FutureResult<'a, (), Self::Error>
where
Self: 'a;

/// Load changes.
fn load(persister: &mut Self) -> FutureResult<Option<ChangeSet>, Self::Error>;
fn load<'a>(persister: &'a mut Self) -> FutureResult<'a, Option<ChangeSet>, Self::Error>
where
Self: 'a;
}

/// Represents a persisted wallet.
Expand Down

0 comments on commit 8498a5f

Please sign in to comment.