Skip to content

Commit b5b9905

Browse files
author
Daniel Salinas
committed
Corrections after merge
1 parent e75c85e commit b5b9905

File tree

5 files changed

+42
-35
lines changed

5 files changed

+42
-35
lines changed

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

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
use std::{fs, num::NonZeroUsize, path::Path, sync::Arc, time::Duration};
22

33
use futures_util::StreamExt;
4-
#[cfg(not(target_family = "wasm"))]
5-
use matrix_sdk::{
6-
reqwest::{Certificate, Proxy},
7-
SqliteStoreConfig
8-
};
94
use matrix_sdk::{
10-
authentication::oauth::qrcode::{self, DeviceCodeErrorResponseType, LoginFailureReason}, crypto::{
5+
authentication::oauth::qrcode::{self, DeviceCodeErrorResponseType, LoginFailureReason},
6+
crypto::{
117
types::qr_login::{LoginQrCodeDecodeError, QrCodeModeData},
128
CollectStrategy, TrustRequirement,
13-
}, encryption::{BackupDownloadStrategy, EncryptionSettings}, event_cache::EventCacheError, ruma::{ServerName, UserId}, sliding_sync::{
9+
},
10+
encryption::{BackupDownloadStrategy, EncryptionSettings},
11+
event_cache::EventCacheError,
12+
ruma::{ServerName, UserId},
13+
sliding_sync::{
1414
Error as MatrixSlidingSyncError, VersionBuilder as MatrixSlidingSyncVersionBuilder,
1515
VersionBuilderError,
16-
}, Client as MatrixClient, ClientBuildError as MatrixClientBuildError, HttpError, IdParseError, RumaApiError, SendOutsideWasm, SyncOutsideWasm
16+
},
17+
Client as MatrixClient, ClientBuildError as MatrixClientBuildError, HttpError, IdParseError,
18+
RumaApiError, SendOutsideWasm, SyncOutsideWasm,
19+
};
20+
#[cfg(not(target_family = "wasm"))]
21+
use matrix_sdk::{
22+
reqwest::{Certificate, Proxy},
23+
SqliteStoreConfig,
1724
};
18-
use matrix_sdk_common::{runtime::get_runtime_handle, SendOutsideWasm, SyncOutsideWasm};
25+
use matrix_sdk_common::runtime::get_runtime_handle;
1926
use ruma::api::error::{DeserializationError, FromHttpResponseError};
2027
use tracing::{debug, error};
2128
use zeroize::Zeroizing;

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -567,26 +567,26 @@ fn setup_lightweight_tokio_runtime() {
567567
async_compat::set_runtime_builder(Box::new(|| {
568568
eprintln!("spawning a lightweight tokio runtime");
569569

570-
// Get the number of available cores through the system, if possible.
571-
let num_available_cores =
572-
std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1);
573-
574-
// The number of worker threads will be either that or 4, whichever is smaller.
575-
let num_worker_threads = num_available_cores.min(4);
576-
577-
// Chosen by a fair dice roll.
578-
let num_blocking_threads = 2;
579-
580-
// 1 MiB of memory per worker thread. Should be enough for everyone™.
581-
let max_memory_bytes = 1024 * 1024;
582-
583-
let mut builder = tokio::runtime::Builder::new_multi_thread();
584-
builder
585-
.enable_all()
586-
.worker_threads(num_worker_threads)
587-
.thread_stack_size(max_memory_bytes)
588-
.max_blocking_threads(num_blocking_threads);
589-
builder
570+
// Get the number of available cores through the system, if possible.
571+
let num_available_cores =
572+
std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1);
573+
574+
// The number of worker threads will be either that or 4, whichever is smaller.
575+
let num_worker_threads = num_available_cores.min(4);
576+
577+
// Chosen by a fair dice roll.
578+
let num_blocking_threads = 2;
579+
580+
// 1 MiB of memory per worker thread. Should be enough for everyone™.
581+
let max_memory_bytes = 1024 * 1024;
582+
583+
let mut builder = tokio::runtime::Builder::new_multi_thread();
584+
builder
585+
.enable_all()
586+
.worker_threads(num_worker_threads)
587+
.thread_stack_size(max_memory_bytes)
588+
.max_blocking_threads(num_blocking_threads);
589+
builder
590590
}));
591591
}
592592

bindings/matrix-sdk-ffi/src/timeline/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ use matrix_sdk::{
3030
reply::{EnforceThread, Reply},
3131
},
3232
};
33-
use matrix_sdk_common::executor::{AbortHandle, JoinHandle};
34-
use matrix_sdk_common::runtime::get_runtime_handle;
33+
use matrix_sdk_common::{
34+
executor::{AbortHandle, JoinHandle},
35+
runtime::get_runtime_handle,
36+
};
3537
use matrix_sdk_ui::timeline::{
3638
self, AttachmentSource, EventItemOrigin, Profile, TimelineDetails,
3739
TimelineUniqueId as SdkTimelineUniqueId,

crates/matrix-sdk/src/client/futures.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
use std::{fmt::Debug, future::IntoFuture};
1818

19-
use eyeball::SharedObservable;
20-
use eyeball::Subscriber;
19+
use eyeball::{SharedObservable, Subscriber};
2120
use js_int::UInt;
2221
use matrix_sdk_common::{boxed_into_future, SendOutsideWasm, SyncOutsideWasm};
2322
use oauth2::{basic::BasicErrorResponseType, RequestTokenError};

crates/matrix-sdk/src/encryption/futures.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919

2020
use std::{future::IntoFuture, io::Read};
2121

22-
use eyeball::SharedObservable;
23-
use eyeball::Subscriber;
22+
use eyeball::{SharedObservable, Subscriber};
2423
use matrix_sdk_common::boxed_into_future;
2524
use ruma::events::room::{EncryptedFile, EncryptedFileInit};
2625

0 commit comments

Comments
 (0)