Skip to content

Commit 5a40876

Browse files
Daniel SalinasDaniel Salinas
authored andcommitted
Update matrix-sdk-common utils that are in existing PRs already
1 parent 16ace96 commit 5a40876

File tree

19 files changed

+289
-75
lines changed

19 files changed

+289
-75
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ as_variant = "1.3.0"
2525
assert-json-diff = "2.0.2"
2626
assert_matches = "1.5.0"
2727
assert_matches2 = "0.1.2"
28+
async-compat = "0.2.4"
2829
async-rx = "0.1.3"
2930
async-stream = "0.3.5"
3031
async-trait = "0.1.85"

bindings/matrix-sdk-ffi/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ bundled-sqlite = ["matrix-sdk/bundled-sqlite"]
2323
[dependencies]
2424
anyhow.workspace = true
2525
as_variant.workspace = true
26-
async-compat = "0.2.4"
26+
async-compat.workspace = true
2727
extension-trait = "1.0.1"
2828
eyeball-im.workspace = true
2929
futures-util.workspace = true
3030
language-tags = "0.3.2"
3131
log-panics = { version = "2", features = ["with-backtrace"] }
32+
matrix-sdk-common.workspace = true
3233
matrix-sdk-ffi-macros.workspace = true
3334
matrix-sdk-ui = { workspace = true, features = ["uniffi"] }
3435
mime = "0.3.16"

bindings/matrix-sdk-ffi/src/client.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use std::{
77
};
88

99
use anyhow::{anyhow, Context as _};
10-
use async_compat::get_runtime_handle;
11-
use futures_util::{pin_mut, StreamExt};
10+
use futures_util::pin_mut;
1211
use matrix_sdk::{
1312
authentication::oauth::{
1413
AccountManagementActionFull, ClientId, OAuthAuthorizationData, OAuthSession,
@@ -41,6 +40,8 @@ use matrix_sdk::{
4140
AuthApi, AuthSession, Client as MatrixClient, SessionChange, SessionTokens,
4241
STATE_STORE_DATABASE_NAME,
4342
};
43+
use matrix_sdk_common::runtime::get_runtime_handle;
44+
use matrix_sdk_common::stream::StreamExt;
4445
use matrix_sdk_common::{AsyncTraitDeps, SendOutsideWasm, SyncOutsideWasm};
4546
use matrix_sdk_ui::{
4647
notification_client::{

bindings/matrix-sdk-ffi/src/client_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::{fs, num::NonZeroUsize, path::Path, sync::Arc, time::Duration};
22

33
use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm};
44

5-
use async_compat::get_runtime_handle;
65
use futures_util::StreamExt;
76
use matrix_sdk::{
87
authentication::oauth::qrcode::{self, DeviceCodeErrorResponseType, LoginFailureReason},
@@ -21,6 +20,7 @@ use matrix_sdk::{
2120
Client as MatrixClient, ClientBuildError as MatrixClientBuildError, HttpError, IdParseError,
2221
RumaApiError, SqliteStoreConfig,
2322
};
23+
use matrix_sdk_common::runtime::get_runtime_handle;
2424
use ruma::api::error::{DeserializationError, FromHttpResponseError};
2525
use tracing::{debug, error};
2626
use zeroize::Zeroizing;

bindings/matrix-sdk-ffi/src/encryption.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use std::sync::Arc;
22

3-
use async_compat::get_runtime_handle;
43
use futures_util::StreamExt;
54
use matrix_sdk::{
65
encryption,
76
encryption::{backups, recovery},
87
};
8+
use matrix_sdk_common::runtime::get_runtime_handle;
99
use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm};
1010
use thiserror::Error;
1111
use tracing::{error, info};

bindings/matrix-sdk-ffi/src/room.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::{collections::HashMap, pin::pin, sync::Arc};
22

33
use anyhow::{Context, Result};
4-
use async_compat::get_runtime_handle;
54
use futures_util::{pin_mut, StreamExt};
65
use matrix_sdk::{
76
crypto::LocalTrust,
@@ -13,6 +12,7 @@ use matrix_sdk::{
1312
PredecessorRoom as SdkPredecessorRoom, RoomHero as SdkRoomHero, RoomMemberships, RoomState,
1413
SuccessorRoom as SdkSuccessorRoom,
1514
};
15+
use matrix_sdk_common::runtime::get_runtime_handle;
1616
use matrix_sdk_ui::{
1717
timeline::{default_event_filter, RoomExt, TimelineBuilder},
1818
unable_to_decrypt_hook::UtdHookManager,

bindings/matrix-sdk-ffi/src/room_directory_search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
use std::{fmt::Debug, sync::Arc};
1717

18-
use async_compat::get_runtime_handle;
1918
use eyeball_im::VectorDiff;
2019
use futures_util::StreamExt;
2120
use matrix_sdk::room_directory_search::RoomDirectorySearch as SdkRoomDirectorySearch;
21+
use matrix_sdk_common::runtime::get_runtime_handle;
2222
use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm};
2323
use ruma::ServerName;
2424
use tokio::sync::RwLock;

bindings/matrix-sdk-ffi/src/room_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use std::{fmt::Debug, mem::MaybeUninit, ptr::addr_of_mut, sync::Arc, time::Duration};
44

5-
use async_compat::get_runtime_handle;
65
use eyeball_im::VectorDiff;
76
use futures_util::{pin_mut, StreamExt};
87
use matrix_sdk::{
@@ -12,6 +11,7 @@ use matrix_sdk::{
1211
},
1312
Room as SdkRoom,
1413
};
14+
use matrix_sdk_common::runtime::get_runtime_handle;
1515
use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm};
1616
use matrix_sdk_ui::{
1717
room_list_service::filters::{

bindings/matrix-sdk-ffi/src/session_verification.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::sync::{Arc, RwLock};
22

3-
use async_compat::get_runtime_handle;
43
use futures_util::StreamExt;
54
use matrix_sdk::{
65
encryption::{
@@ -11,6 +10,7 @@ use matrix_sdk::{
1110
ruma::events::key::verification::VerificationMethod,
1211
Account,
1312
};
13+
use matrix_sdk_common::runtime::get_runtime_handle;
1414
use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm};
1515
use ruma::UserId;
1616
use tracing::{error, warn};

0 commit comments

Comments
 (0)