Skip to content

Commit

Permalink
fixup! fix(ffi): don't panic when running into an unknown membership …
Browse files Browse the repository at this point in the history
…state
  • Loading branch information
bnjbvr committed Oct 17, 2024
1 parent b74371b commit e1ed5c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions bindings/matrix-sdk-ffi/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,8 @@ impl From<matrix_sdk::Error> for NotificationSettingsError {
Self::Generic { msg: e.to_string() }
}
}

/// Something has not been implemented yet.
#[derive(thiserror::Error, Debug)]
#[error("not implemented yet")]
pub struct NotYetImplemented;
7 changes: 1 addition & 6 deletions bindings/matrix-sdk-ffi/src/room_member.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use matrix_sdk::room::{RoomMember as SdkRoomMember, RoomMemberRole};
use ruma::UserId;

use crate::error::ClientError;
use crate::error::{ClientError, NotYetImplemented};

#[derive(Clone, uniffi::Enum)]
pub enum MembershipState {
Expand All @@ -24,11 +24,6 @@ pub enum MembershipState {
Custom(String),
}

/// Something has not been implemented yet.
#[derive(thiserror::Error, Debug)]
#[error("not implemented yet")]
pub struct NotYetImplemented;

impl TryFrom<matrix_sdk::ruma::events::room::member::MembershipState> for MembershipState {
type Error = NotYetImplemented;

Expand Down

0 comments on commit e1ed5c2

Please sign in to comment.