Skip to content

Commit 4eb3ec7

Browse files
committed
Upgrade Ruma after api::Error breaking change
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 parent 6c50897 commit 4eb3ec7

File tree

24 files changed

+107
-119
lines changed

24 files changed

+107
-119
lines changed

Cargo.lock

Lines changed: 10 additions & 10 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rand = { version = "0.10.0", default-features = false, features = ["std", "std_r
7171
regex = { version = "1.12.2", default-features = false }
7272
reqwest = { version = "0.13.1", default-features = false }
7373
rmp-serde = { version = "1.3.0", default-features = false }
74-
ruma = { git = "https://github.com/ruma/ruma", rev = "390d07ba915003fb8c5c625cf461d4c43370fa6a", features = [
74+
ruma = { git = "https://github.com/ruma/ruma", rev = "7680eebd9586669e1a4e5b1fd1c2c691221369d4", features = [
7575
"client-api-c",
7676
"compat-unset-avatar",
7777
"compat-upload-signatures",

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,17 @@ use matrix_sdk_ui::{
7171
use mime::Mime;
7272
use oauth2::Scope;
7373
use ruma::{
74-
api::client::{
75-
alias::get_alias,
76-
discovery::get_authorization_server_metadata::v1::{
77-
AccountManagementActionData, DeviceDeleteData, DeviceViewData,
74+
api::{
75+
client::{
76+
alias::get_alias,
77+
discovery::get_authorization_server_metadata::v1::{
78+
AccountManagementActionData, DeviceDeleteData, DeviceViewData,
79+
},
80+
profile::{AvatarUrl, DisplayName},
81+
room::create_room::{v3::CreationContent, RoomPowerLevelsContentOverride},
82+
uiaa::{EmailUserIdentifier, UserIdentifier},
7883
},
7984
error::ErrorKind,
80-
profile::{AvatarUrl, DisplayName},
81-
room::create_room::{v3::CreationContent, RoomPowerLevelsContentOverride},
82-
uiaa::{EmailUserIdentifier, UserIdentifier},
8385
},
8486
events::{
8587
direct::DirectEventContent,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use matrix_sdk::{
2626
};
2727
use matrix_sdk_ui::{encryption_sync_service, notification_client, spaces, sync_service, timeline};
2828
use ruma::{
29-
api::client::error::{ErrorBody, ErrorKind as RumaApiErrorKind, RetryAfter, StandardErrorBody},
29+
api::error::{ErrorBody, ErrorKind as RumaApiErrorKind, RetryAfter, StandardErrorBody},
3030
MilliSecondsSinceUnixEpoch,
3131
};
3232
use tracing::warn;

crates/matrix-sdk-ui/src/sync_service.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,7 @@ impl TerminationReport {
742742
match &self.error {
743743
Some(Error::RoomList(room_list_service::Error::SlidingSync(error)))
744744
| Some(Error::EncryptionSync(encryption_sync_service::Error::SlidingSync(error))) => {
745-
error.client_api_error_kind()
746-
== Some(&ruma::api::client::error::ErrorKind::UnknownPos)
745+
error.client_api_error_kind() == Some(&ruma::api::error::ErrorKind::UnknownPos)
747746
}
748747
_ => false,
749748
}

crates/matrix-sdk-ui/tests/integration/timeline/queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ async fn test_reloaded_failed_local_echoes_are_marked_as_failed() {
315315
// And it's properly pattern-matched as an HTTP error.
316316
assert_matches!(
317317
error.as_client_api_error().unwrap().error_kind(),
318-
Some(ruma::api::client::error::ErrorKind::TooLarge)
318+
Some(ruma::api::error::ErrorKind::TooLarge)
319319
);
320320

321321
assert_pending!(timeline_stream);

crates/matrix-sdk/src/account.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ use ruma::{
4040
request_3pid_management_token_via_email, request_3pid_management_token_via_msisdn,
4141
},
4242
config::{get_global_account_data, set_global_account_data},
43-
error::ErrorKind,
4443
profile::{
4544
DisplayName, StaticProfileField, delete_profile_field, get_avatar_url, get_profile,
4645
get_profile_field, set_avatar_url, set_display_name, set_profile_field,
4746
},
4847
uiaa::AuthData,
4948
},
49+
error::ErrorKind,
5050
},
5151
assign,
5252
events::{
@@ -379,7 +379,7 @@ impl Account {
379379
/// response, which would result in `Ok(None)`. Note that this error code
380380
/// might also mean that the given user ID doesn't exist.
381381
///
382-
/// [`ErrorCode::NotFound`]: ruma::api::client::error::ErrorCode::NotFound
382+
/// [`ErrorCode::NotFound`]: ruma::api::error::ErrorCode::NotFound
383383
pub async fn fetch_profile_field_of(
384384
&self,
385385
user_id: OwnedUserId,
@@ -411,7 +411,7 @@ impl Account {
411411
/// response, which would result in `Ok(None)`. Note that this error code
412412
/// might also mean that the given user ID doesn't exist.
413413
///
414-
/// [`ErrorCode::NotFound`]: ruma::api::client::error::ErrorCode::NotFound
414+
/// [`ErrorCode::NotFound`]: ruma::api::error::ErrorCode::NotFound
415415
pub async fn fetch_profile_field_of_static<F>(
416416
&self,
417417
user_id: OwnedUserId,
@@ -517,7 +517,7 @@ impl Account {
517517
/// ```
518518
/// [uiaa]: https://spec.matrix.org/v1.2/client-server-api/#user-interactive-authentication-api
519519
/// [`UiaaResponse`]: ruma::api::client::uiaa::UiaaResponse
520-
/// [`ErrorKind::WeakPassword`]: ruma::api::client::error::ErrorKind::WeakPassword
520+
/// [`ErrorKind::WeakPassword`]: ruma::api::error::ErrorKind::WeakPassword
521521
pub async fn change_password(
522522
&self,
523523
new_password: &str,
@@ -668,8 +668,8 @@ impl Account {
668668
/// # anyhow::Ok(()) };
669669
/// ```
670670
/// [3pid]: https://spec.matrix.org/v1.2/appendices/#3pid-types
671-
/// [`ErrorKind::ThreepidInUse`]: ruma::api::client::error::ErrorKind::ThreepidInUse
672-
/// [`ErrorKind::ThreepidDenied`]: ruma::api::client::error::ErrorKind::ThreepidDenied
671+
/// [`ErrorKind::ThreepidInUse`]: ruma::api::error::ErrorKind::ThreepidInUse
672+
/// [`ErrorKind::ThreepidDenied`]: ruma::api::error::ErrorKind::ThreepidDenied
673673
pub async fn request_3pid_email_token(
674674
&self,
675675
client_secret: &ClientSecret,
@@ -743,8 +743,8 @@ impl Account {
743743
/// # anyhow::Ok(()) };
744744
/// ```
745745
/// [3pid]: https://spec.matrix.org/v1.2/appendices/#3pid-types
746-
/// [`ErrorKind::ThreepidInUse`]: ruma::api::client::error::ErrorKind::ThreepidInUse
747-
/// [`ErrorKind::ThreepidDenied`]: ruma::api::client::error::ErrorKind::ThreepidDenied
746+
/// [`ErrorKind::ThreepidInUse`]: ruma::api::error::ErrorKind::ThreepidInUse
747+
/// [`ErrorKind::ThreepidDenied`]: ruma::api::error::ErrorKind::ThreepidDenied
748748
pub async fn request_3pid_msisdn_token(
749749
&self,
750750
client_secret: &ClientSecret,

crates/matrix-sdk/src/authentication/matrix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ impl MatrixAuth {
504504
/// ```
505505
///
506506
/// [refreshing access tokens]: https://spec.matrix.org/v1.3/client-server-api/#refreshing-access-tokens
507-
/// [`UnknownToken`]: ruma::api::client::error::ErrorKind::UnknownToken
507+
/// [`UnknownToken`]: ruma::api::error::ErrorKind::UnknownToken
508508
/// [restore the session]: Client::restore_session
509509
/// [`ClientBuilder::handle_refresh_tokens()`]: crate::ClientBuilder::handle_refresh_tokens
510510
pub async fn refresh_access_token(&self) -> Result<(), RefreshTokenError> {

crates/matrix-sdk/src/authentication/oauth/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@
155155
//! [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108
156156
//! [RFC 8628]: https://datatracker.ietf.org/doc/html/rfc8628
157157
//! [`ClientBuilder::handle_refresh_tokens()`]: crate::ClientBuilder::handle_refresh_tokens()
158-
//! [`Error`]: ruma::api::client::error::Error
159-
//! [`ErrorKind::UnknownToken`]: ruma::api::client::error::ErrorKind::UnknownToken
158+
//! [`Error`]: ruma::api::error::Error
159+
//! [`ErrorKind::UnknownToken`]: ruma::api::error::ErrorKind::UnknownToken
160160
//! [`examples/oauth_cli`]: https://github.com/matrix-org/matrix-rust-sdk/tree/main/examples/oauth_cli
161161
162162
#[cfg(feature = "e2e-encryption")]

crates/matrix-sdk/src/authentication/oauth/qrcode/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub use oauth2::{
3333
RequestTokenError, StandardErrorResponse,
3434
basic::{BasicErrorResponse, BasicRequestTokenError},
3535
};
36-
use ruma::api::{client::error::ErrorKind, error::FromHttpResponseError};
36+
use ruma::api::error::{ErrorKind, FromHttpResponseError};
3737
use thiserror::Error;
3838
use tokio::sync::Mutex;
3939
use url::Url;

0 commit comments

Comments
 (0)