Skip to content

Commit

Permalink
Address lifetime traits issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Salinas authored and Daniel Salinas committed Jan 17, 2025
1 parent bad8e91 commit b11f0b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions bindings/matrix-sdk-ffi/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ pub trait ClientDelegate: Sync + Send {
#[matrix_sdk_ffi_macros::export(callback_interface)]
#[async_trait::async_trait]
pub trait ClientSessionDelegate: Sync + Send {
async fn retrieve_session_from_keychain(&self, user_id: String)
-> Result<Session, ClientError>;
async fn save_session_in_keychain(&self, session: Session);
async fn retrieve_session_from_keychain<'a>(
&'a self,
user_id: String,
) -> Result<Session, ClientError>;
async fn save_session_in_keychain<'a>(&'a self, session: Session);
}

#[matrix_sdk_ffi_macros::export(callback_interface)]
Expand Down
4 changes: 2 additions & 2 deletions crates/matrix-sdk/src/oidc/cross_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ mod tests {
impl ReloadSessionCallback for TestReloadSessionCallback {
async fn reload_session(
&self,
client: Client,
_client: Client,
) -> Result<SessionTokens, SessionCallbackError> {
Ok(SessionTokens::Oidc(self.tokens.clone()))
}
Expand All @@ -296,7 +296,7 @@ mod tests {

#[async_trait::async_trait]
impl SaveSessionCallback for TestSaveSessionCallback {
async fn save_session(&self, client: Client) -> Result<(), SessionCallbackError> {
async fn save_session(&self, _client: Client) -> Result<(), SessionCallbackError> {
panic!("save_session_callback shouldn't be called here")
}
}
Expand Down

0 comments on commit b11f0b7

Please sign in to comment.