Skip to content

Commit

Permalink
bindings: Use proc-macros for types no longer referenced in UDL
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Apr 27, 2023
1 parent e2f1302 commit 6307f6c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 25 deletions.
3 changes: 2 additions & 1 deletion bindings/matrix-sdk-crypto-ffi/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ pub enum SignatureError {
UnknownUserIdentity(String),
}

#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
#[uniffi(flat_error)]
pub enum CryptoStoreError {
#[error("Failed to open the store")]
OpenStore(#[from] OpenStoreError),
Expand Down
10 changes: 0 additions & 10 deletions bindings/matrix-sdk-crypto-ffi/src/olm.udl
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ callback interface ProgressListener {
void on_progress(i32 progress, i32 total);
};

[Error]
enum CryptoStoreError {
"OpenStore",
"CryptoStore",
"OlmError",
"Serialization",
"InvalidUserId",
"Identifier",
};

dictionary CancelInfo {
string cancel_code;
string reason;
Expand Down
13 changes: 0 additions & 13 deletions bindings/matrix-sdk-ffi/src/api.udl
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
namespace matrix_sdk_ffi {};

[Error]
interface ClientError {
Generic(string msg);
};

callback interface ClientDelegate {
void did_receive_auth_error(boolean is_soft_logout);
};
Expand Down Expand Up @@ -148,11 +143,3 @@ callback interface SessionVerificationControllerDelegate {
void did_cancel();
void did_finish();
};

enum LogLevel {
"Error",
"Warn",
"Info",
"Debug",
"Trace",
};
2 changes: 1 addition & 1 deletion bindings/matrix-sdk-ffi/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use matrix_sdk::{self, encryption::CryptoStoreError, HttpError, IdParseError, StoreError};

#[derive(thiserror::Error, Debug)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum ClientError {
#[error("client error: {msg}")]
Generic { msg: String },
Expand Down
1 change: 1 addition & 0 deletions bindings/matrix-sdk-ffi/src/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ impl Span {
}
}

#[derive(uniffi::Enum)]
pub enum LogLevel {
Error,
Warn,
Expand Down

0 comments on commit 6307f6c

Please sign in to comment.