Skip to content

Commit fa42373

Browse files
committed
Merge branch 'client-arc'
2 parents a8c36b4 + b4220bd commit fa42373

File tree

18 files changed

+354
-295
lines changed

18 files changed

+354
-295
lines changed

crates/matrix-sdk-appservice/src/webserver/warp.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use std::{net::ToSocketAddrs, result::Result as StdResult};
15+
use std::net::ToSocketAddrs;
1616

1717
use matrix_sdk::{
1818
bytes::Bytes,
@@ -168,7 +168,7 @@ mod handlers {
168168
_user_id: String,
169169
appservice: AppService,
170170
request: http::Request<Bytes>,
171-
) -> StdResult<impl warp::Reply, Rejection> {
171+
) -> Result<impl warp::Reply, Rejection> {
172172
if let Some(user_exists) = appservice.event_handler.users.lock().await.as_mut() {
173173
let request =
174174
query_user::IncomingRequest::try_from_http_request(request).map_err(Error::from)?;
@@ -185,7 +185,7 @@ mod handlers {
185185
_room_id: String,
186186
appservice: AppService,
187187
request: http::Request<Bytes>,
188-
) -> StdResult<impl warp::Reply, Rejection> {
188+
) -> Result<impl warp::Reply, Rejection> {
189189
if let Some(room_exists) = appservice.event_handler.rooms.lock().await.as_mut() {
190190
let request =
191191
query_room::IncomingRequest::try_from_http_request(request).map_err(Error::from)?;
@@ -202,7 +202,7 @@ mod handlers {
202202
_txn_id: String,
203203
appservice: AppService,
204204
request: http::Request<Bytes>,
205-
) -> StdResult<impl warp::Reply, Rejection> {
205+
) -> Result<impl warp::Reply, Rejection> {
206206
let incoming_transaction: ruma::api::appservice::event::push_events::v1::IncomingRequest =
207207
ruma::api::IncomingRequest::try_from_http_request(request).map_err(Error::from)?;
208208

@@ -224,7 +224,7 @@ struct ErrorMessage {
224224
message: String,
225225
}
226226

227-
pub async fn handle_rejection(err: Rejection) -> std::result::Result<impl Reply, Rejection> {
227+
pub async fn handle_rejection(err: Rejection) -> Result<impl Reply, Rejection> {
228228
if err.find::<Unauthorized>().is_some() || err.find::<warp::reject::InvalidQuery>().is_some() {
229229
let code = http::StatusCode::UNAUTHORIZED;
230230
let message = "UNAUTHORIZED";

crates/matrix-sdk-base/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ default-features = false
5050
features = ["sync", "fs"]
5151

5252
[dev-dependencies]
53-
futures = { version = "0.3.15", default-features = false }
53+
futures = { version = "0.3.15", default-features = false, features = ["executor"] }
5454
http = "0.2.4"
5555
matrix-sdk-test = { version = "0.4.0", path = "../matrix-sdk-test" }
5656

crates/matrix-sdk-common/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ version = "0.1.9"
3333
features = ["now"]
3434

3535
[target.'cfg(target_arch = "wasm32")'.dependencies]
36-
futures-util = { version = "0.3.15", default-features = false }
37-
futures-locks = { version = "0.6.0", default-features = false }
36+
async-lock = "2.4.0"
37+
futures-util = { version = "0.3.15", default-features = false, features = ["channel"] }
3838
wasm-bindgen-futures = "0.4.24"
3939
uuid = { version = "0.8.2", default-features = false, features = ["v4", "wasm-bindgen"] }

crates/matrix-sdk-common/src/locks.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// could switch to futures-lock completely at some point, blocker:
2-
// https://github.com/asomers/futures-locks/issues/34
3-
// https://www.reddit.com/r/rust/comments/f4zldz/i_audited_3_different_implementation_of_async/
4-
51
#[cfg(target_arch = "wasm32")]
6-
pub use futures_locks::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
2+
pub use async_lock::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
73
#[cfg(not(target_arch = "wasm32"))]
84
pub use tokio::sync::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};

crates/matrix-sdk-crypto/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ criterion = { version = "0.3.4", features = [
5656
"async_tokio",
5757
"html_reports",
5858
] }
59-
futures = { version = "0.3.15", default-features = false }
59+
futures = { version = "0.3.15", default-features = false, features = ["executor"] }
6060
http = "0.2.4"
6161
indoc = "1.0.3"
6262
matches = "0.1.8"

crates/matrix-sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ features = ["wasm-bindgen"]
108108
[dev-dependencies]
109109
anyhow = "1.0"
110110
dirs = "3.0.2"
111-
futures = { version = "0.3.15", default-features = false }
111+
futures = { version = "0.3.15", default-features = false, features = ["executor"] }
112112
lazy_static = "1.4.0"
113113
matches = "0.1.8"
114114
matrix-sdk-test = { version = "0.4.0", path = "../matrix-sdk-test" }

0 commit comments

Comments
 (0)