From 4a7010bab15be6b5d61f6c5da7413c9918104432 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 23 Jun 2021 12:06:28 +0200 Subject: [PATCH] Reexport independent external crates entirely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … instead of reexporting individual items. --- matrix_sdk/examples/autojoin.rs | 4 +- matrix_sdk/examples/command_bot.rs | 6 +- .../examples/cross_signing_bootstrap.rs | 3 +- matrix_sdk/examples/emoji_verification.rs | 8 ++- matrix_sdk/examples/get_profiles.rs | 4 +- matrix_sdk/examples/image_bot.rs | 4 +- matrix_sdk/examples/login.rs | 4 +- .../examples/wasm_command_bot/src/lib.rs | 10 +-- matrix_sdk/src/client.rs | 66 +++++++++++-------- matrix_sdk/src/device.rs | 2 +- matrix_sdk/src/event_handler/mod.rs | 2 +- matrix_sdk/src/http_client.rs | 5 +- matrix_sdk/src/lib.rs | 21 +----- matrix_sdk/src/room/common.rs | 10 +-- matrix_sdk/src/room/joined.rs | 21 +++--- matrix_sdk/src/room_member.rs | 2 +- matrix_sdk/src/verification/sas.rs | 2 +- .../examples/appservice_autojoin.rs | 12 ++-- matrix_sdk_appservice/src/lib.rs | 4 +- matrix_sdk_appservice/src/webserver/warp.rs | 8 +-- matrix_sdk_appservice/tests/tests.rs | 6 +- 21 files changed, 105 insertions(+), 99 deletions(-) diff --git a/matrix_sdk/examples/autojoin.rs b/matrix_sdk/examples/autojoin.rs index f2ac3c1b..6838b7c1 100644 --- a/matrix_sdk/examples/autojoin.rs +++ b/matrix_sdk/examples/autojoin.rs @@ -1,9 +1,9 @@ use std::{env, process::exit}; use matrix_sdk::{ - self, async_trait, - events::{room::member::MemberEventContent, StrippedStateEvent}, + async_trait, room::Room, + ruma::events::{room::member::MemberEventContent, StrippedStateEvent}, Client, ClientConfig, EventHandler, SyncSettings, }; use tokio::time::{sleep, Duration}; diff --git a/matrix_sdk/examples/command_bot.rs b/matrix_sdk/examples/command_bot.rs index d6c00fda..90f00e38 100644 --- a/matrix_sdk/examples/command_bot.rs +++ b/matrix_sdk/examples/command_bot.rs @@ -1,12 +1,12 @@ use std::{env, process::exit}; use matrix_sdk::{ - self, async_trait, - events::{ + async_trait, + room::Room, + ruma::events::{ room::message::{MessageEventContent, MessageType, TextMessageEventContent}, AnyMessageEventContent, SyncMessageEvent, }, - room::Room, Client, ClientConfig, EventHandler, SyncSettings, }; use url::Url; diff --git a/matrix_sdk/examples/cross_signing_bootstrap.rs b/matrix_sdk/examples/cross_signing_bootstrap.rs index 107cfc58..cb6a5c74 100644 --- a/matrix_sdk/examples/cross_signing_bootstrap.rs +++ b/matrix_sdk/examples/cross_signing_bootstrap.rs @@ -6,7 +6,8 @@ use std::{ }; use matrix_sdk::{ - self, api::r0::uiaa::AuthData, identifiers::UserId, Client, LoopCtrl, SyncSettings, + ruma::{api::client::r0::uiaa::AuthData, UserId}, + Client, LoopCtrl, SyncSettings, }; use serde_json::json; use url::Url; diff --git a/matrix_sdk/examples/emoji_verification.rs b/matrix_sdk/examples/emoji_verification.rs index 60e93b6c..90c7fd43 100644 --- a/matrix_sdk/examples/emoji_verification.rs +++ b/matrix_sdk/examples/emoji_verification.rs @@ -9,8 +9,12 @@ use std::{ use matrix_sdk::{ self, - events::{room::message::MessageType, AnySyncMessageEvent, AnySyncRoomEvent, AnyToDeviceEvent}, - identifiers::UserId, + ruma::{ + events::{ + room::message::MessageType, AnySyncMessageEvent, AnySyncRoomEvent, AnyToDeviceEvent, + }, + UserId, + }, verification::{SasVerification, Verification}, Client, LoopCtrl, SyncSettings, }; diff --git a/matrix_sdk/examples/get_profiles.rs b/matrix_sdk/examples/get_profiles.rs index 1e8f5719..edbfcb1c 100644 --- a/matrix_sdk/examples/get_profiles.rs +++ b/matrix_sdk/examples/get_profiles.rs @@ -1,9 +1,7 @@ use std::{convert::TryFrom, env, process::exit}; use matrix_sdk::{ - self, - api::r0::profile, - identifiers::{MxcUri, UserId}, + ruma::{api::client::r0::profile, MxcUri, UserId}, Client, Result as MatrixResult, }; use url::Url; diff --git a/matrix_sdk/examples/image_bot.rs b/matrix_sdk/examples/image_bot.rs index 4408e1c3..7df95ffd 100644 --- a/matrix_sdk/examples/image_bot.rs +++ b/matrix_sdk/examples/image_bot.rs @@ -9,11 +9,11 @@ use std::{ use matrix_sdk::{ self, async_trait, - events::{ + room::Room, + ruma::events::{ room::message::{MessageEventContent, MessageType, TextMessageEventContent}, SyncMessageEvent, }, - room::Room, Client, EventHandler, SyncSettings, }; use tokio::sync::Mutex; diff --git a/matrix_sdk/examples/login.rs b/matrix_sdk/examples/login.rs index 31a71acd..fa6ab054 100644 --- a/matrix_sdk/examples/login.rs +++ b/matrix_sdk/examples/login.rs @@ -2,11 +2,11 @@ use std::{env, process::exit}; use matrix_sdk::{ self, async_trait, - events::{ + room::Room, + ruma::events::{ room::message::{MessageEventContent, MessageType, TextMessageEventContent}, SyncMessageEvent, }, - room::Room, Client, EventHandler, SyncSettings, }; use url::Url; diff --git a/matrix_sdk/examples/wasm_command_bot/src/lib.rs b/matrix_sdk/examples/wasm_command_bot/src/lib.rs index 7f4abbb4..a94cafab 100644 --- a/matrix_sdk/examples/wasm_command_bot/src/lib.rs +++ b/matrix_sdk/examples/wasm_command_bot/src/lib.rs @@ -1,10 +1,12 @@ use matrix_sdk::{ deserialized_responses::SyncResponse, - events::{ - room::message::{MessageEventContent, MessageType, TextMessageEventContent}, - AnyMessageEventContent, AnySyncMessageEvent, AnySyncRoomEvent, SyncMessageEvent, + ruma::{ + events::{ + room::message::{MessageEventContent, MessageType, TextMessageEventContent}, + AnyMessageEventContent, AnySyncMessageEvent, AnySyncRoomEvent, SyncMessageEvent, + }, + RoomId, }, - identifiers::RoomId, Client, LoopCtrl, SyncSettings, }; use url::Url; diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index 21de669f..74b61ef5 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -571,7 +571,7 @@ impl Client { /// # Example /// ```no_run /// # use std::convert::TryFrom; - /// # use matrix_sdk::{Client, identifiers::UserId}; + /// # use matrix_sdk::{Client, ruma::UserId}; /// # use futures::executor::block_on; /// let alice = UserId::try_from("@alice:example.org").unwrap(); /// # block_on(async { @@ -792,7 +792,7 @@ impl Client { /// ```no_run /// # use futures::executor::block_on; /// # use matrix_sdk::Client; - /// # use matrix_sdk::identifiers::room_id; + /// # use matrix_sdk::ruma::room_id; /// # use matrix_sdk::media::MediaFormat; /// # use url::Url; /// # let homeserver = Url::parse("http://example.com").unwrap(); @@ -1001,8 +1001,7 @@ impl Client { /// ```no_run /// # use std::convert::TryFrom; /// # use matrix_sdk::Client; - /// # use matrix_sdk::identifiers::DeviceId; - /// # use matrix_sdk::assign; + /// # use matrix_sdk::ruma::{assign, DeviceId}; /// # use futures::executor::block_on; /// # use url::Url; /// # let homeserver = Url::parse("http://example.com").unwrap(); @@ -1260,8 +1259,7 @@ impl Client { /// ```no_run /// # use std::convert::TryFrom; /// # use matrix_sdk::Client; - /// # use matrix_sdk::identifiers::DeviceId; - /// # use matrix_sdk::assign; + /// # use matrix_sdk::ruma::{assign, DeviceId}; /// # use futures::executor::block_on; /// # use url::Url; /// # let homeserver = Url::parse("https://example.com").unwrap(); @@ -1340,10 +1338,13 @@ impl Client { /// ```no_run /// # use std::convert::TryFrom; /// # use matrix_sdk::Client; - /// # use matrix_sdk::api::r0::account::register::{Request as RegistrationRequest, RegistrationKind}; - /// # use matrix_sdk::api::r0::uiaa::AuthData; - /// # use matrix_sdk::identifiers::DeviceId; - /// # use matrix_sdk::assign; + /// # use matrix_sdk::ruma::{ + /// # api::client::r0::{ + /// # account::register::{Request as RegistrationRequest, RegistrationKind}, + /// # uiaa::AuthData, + /// # }, + /// # assign, DeviceId, + /// # }; /// # use futures::executor::block_on; /// # use url::Url; /// # let homeserver = Url::parse("http://example.com").unwrap(); @@ -1393,7 +1394,7 @@ impl Client { /// ```no_run /// # use matrix_sdk::{ /// # Client, SyncSettings, - /// # api::r0::{ + /// # ruma::api::client::r0::{ /// # filter::{ /// # FilterDefinition, LazyLoadOptions, RoomEventFilter, RoomFilter, /// # }, @@ -1537,7 +1538,10 @@ impl Client { /// # Examples /// ```no_run /// use matrix_sdk::Client; - /// # use matrix_sdk::api::r0::room::{create_room::Request as CreateRoomRequest, Visibility}; + /// # use matrix_sdk::ruma::api::client::r0::room::{ + /// # create_room::Request as CreateRoomRequest, + /// # Visibility, + /// # }; /// # use url::Url; /// /// # let homeserver = Url::parse("http://example.com").unwrap(); @@ -1570,9 +1574,11 @@ impl Client { /// ```no_run /// # use std::convert::TryFrom; /// # use matrix_sdk::Client; - /// # use matrix_sdk::directory::{Filter, RoomNetwork}; - /// # use matrix_sdk::api::r0::directory::get_public_rooms_filtered::Request as PublicRoomsFilterRequest; - /// # use matrix_sdk::assign; + /// # use matrix_sdk::ruma::{ + /// # api::client::r0::directory::get_public_rooms_filtered::Request as PublicRoomsFilterRequest, + /// # directory::{Filter, RoomNetwork}, + /// # assign, + /// # }; /// # use url::Url; /// # use futures::executor::block_on; /// # let homeserver = Url::parse("http://example.com").unwrap(); @@ -1623,7 +1629,7 @@ impl Client { /// /// ```no_run /// # use std::{path::PathBuf, fs::File, io::Read}; - /// # use matrix_sdk::{Client, identifiers::room_id}; + /// # use matrix_sdk::{Client, ruma::room_id}; /// # use url::Url; /// # use futures::executor::block_on; /// # use mime; @@ -1690,9 +1696,9 @@ impl Client { /// # use matrix_sdk::{Client, SyncSettings}; /// # use url::Url; /// # use futures::executor::block_on; - /// # use matrix_sdk::identifiers::room_id; + /// # use matrix_sdk::ruma::room_id; /// # use std::convert::TryFrom; - /// use matrix_sdk::events::{ + /// use matrix_sdk::ruma::events::{ /// AnyMessageEventContent, /// room::message::{MessageEventContent, TextMessageEventContent}, /// }; @@ -1752,8 +1758,7 @@ impl Client { /// # block_on(async { /// # let homeserver = Url::parse("http://localhost:8080").unwrap(); /// # let mut client = Client::new(homeserver).unwrap(); - /// use matrix_sdk::api::r0::profile; - /// use matrix_sdk::identifiers::user_id; + /// use matrix_sdk::ruma::{api::client::r0::profile, user_id}; /// /// // First construct the request you want to make /// // See https://docs.rs/ruma-client-api/latest/ruma_client_api/index.html @@ -1839,8 +1844,11 @@ impl Client { /// /// ```no_run /// # use matrix_sdk::{ - /// # api::r0::uiaa::{UiaaResponse, AuthData}, - /// # Client, SyncSettings, Error, FromHttpResponseError, ServerError, + /// # ruma::api::{ + /// # client::r0::uiaa::{UiaaResponse, AuthData}, + /// # error::{FromHttpResponseError, ServerError}, + /// # }, + /// # Client, Error, SyncSettings, /// # }; /// # use futures::executor::block_on; /// # use serde_json::json; @@ -1959,7 +1967,7 @@ impl Client { /// UI thread. /// /// ```no_run - /// # use matrix_sdk::events::{ + /// # use matrix_sdk::ruma::events::{ /// # room::message::{MessageEvent, MessageEventContent, TextMessageEventContent}, /// # }; /// # use std::sync::{Arc, RwLock}; @@ -2228,7 +2236,7 @@ impl Client { /// /// ```no_run /// # use std::convert::TryFrom; - /// # use matrix_sdk::{Client, identifiers::UserId}; + /// # use matrix_sdk::{Client, ruma::UserId}; /// # use url::Url; /// # use futures::executor::block_on; /// # let alice = UserId::try_from("@alice:example.org").unwrap(); @@ -2270,8 +2278,8 @@ impl Client { /// # Examples /// ```no_run /// # use std::{convert::TryFrom, collections::BTreeMap}; - /// # use matrix_sdk::{Client, identifiers::UserId}; - /// # use matrix_sdk::api::r0::uiaa::AuthData; + /// # use matrix_sdk::{Client, ruma::UserId}; + /// # use matrix_sdk::ruma::api::client::r0::uiaa::AuthData; /// # use url::Url; /// # use futures::executor::block_on; /// # use serde_json::json; @@ -2341,7 +2349,7 @@ impl Client { /// /// ```no_run /// # use std::convert::TryFrom; - /// # use matrix_sdk::{Client, identifiers::UserId}; + /// # use matrix_sdk::{Client, ruma::UserId}; /// # use url::Url; /// # use futures::executor::block_on; /// # let alice = UserId::try_from("@alice:example.org").unwrap(); @@ -2395,7 +2403,7 @@ impl Client { /// # use std::{path::PathBuf, time::Duration}; /// # use matrix_sdk::{ /// # Client, SyncSettings, - /// # identifiers::room_id, + /// # ruma::room_id, /// # }; /// # use futures::executor::block_on; /// # use url::Url; @@ -2465,7 +2473,7 @@ impl Client { /// # use std::{path::PathBuf, time::Duration}; /// # use matrix_sdk::{ /// # Client, SyncSettings, - /// # identifiers::room_id, + /// # ruma::room_id, /// # }; /// # use futures::executor::block_on; /// # use url::Url; diff --git a/matrix_sdk/src/device.rs b/matrix_sdk/src/device.rs index 275060a9..c9e329c6 100644 --- a/matrix_sdk/src/device.rs +++ b/matrix_sdk/src/device.rs @@ -47,7 +47,7 @@ impl Device { /// /// ```no_run /// # use std::convert::TryFrom; - /// # use matrix_sdk::{Client, identifiers::UserId}; + /// # use matrix_sdk::{Client, ruma::UserId}; /// # use url::Url; /// # use futures::executor::block_on; /// # let alice = UserId::try_from("@alice:example.org").unwrap(); diff --git a/matrix_sdk/src/event_handler/mod.rs b/matrix_sdk/src/event_handler/mod.rs index 666bb757..5b21b0a7 100644 --- a/matrix_sdk/src/event_handler/mod.rs +++ b/matrix_sdk/src/event_handler/mod.rs @@ -375,7 +375,7 @@ pub enum CustomEvent<'c> { /// # use matrix_sdk::{ /// # async_trait, /// # EventHandler, -/// # events::{ +/// # ruma::events::{ /// # room::message::{MessageEventContent, MessageType, TextMessageEventContent}, /// # SyncMessageEvent /// # }, diff --git a/matrix_sdk/src/http_client.rs b/matrix_sdk/src/http_client.rs index 1899b5af..6874b90f 100644 --- a/matrix_sdk/src/http_client.rs +++ b/matrix_sdk/src/http_client.rs @@ -18,6 +18,7 @@ use std::{convert::TryFrom, fmt::Debug, sync::Arc}; #[cfg(all(not(target_arch = "wasm32")))] use backoff::{future::retry, Error as RetryError, ExponentialBackoff}; +use bytes::{Bytes, BytesMut}; #[cfg(all(not(target_arch = "wasm32")))] use http::StatusCode; use http::{HeaderValue, Response as HttpResponse}; @@ -30,7 +31,7 @@ use ruma::api::{ use tracing::trace; use url::Url; -use crate::{error::HttpError, Bytes, BytesMut, ClientConfig, RequestConfig, Session}; +use crate::{error::HttpError, ClientConfig, RequestConfig, Session}; /// Abstraction around the http layer. The allows implementors to use different /// http libraries. @@ -54,7 +55,7 @@ pub trait HttpSend: AsyncTraitDeps { /// /// ``` /// use std::convert::TryFrom; - /// use matrix_sdk::{HttpSend, async_trait, HttpError, RequestConfig, Bytes}; + /// use matrix_sdk::{HttpSend, async_trait, HttpError, RequestConfig, bytes::Bytes}; /// /// #[derive(Debug)] /// struct Client(reqwest::Client); diff --git a/matrix_sdk/src/lib.rs b/matrix_sdk/src/lib.rs index eb28e8bd..2397880a 100644 --- a/matrix_sdk/src/lib.rs +++ b/matrix_sdk/src/lib.rs @@ -75,7 +75,7 @@ compile_error!("only one of 'native-tls' or 'rustls-tls' features can be enabled #[cfg(all(feature = "sso_login", target_arch = "wasm32"))] compile_error!("'sso_login' cannot be enabled on 'wasm32' arch"); -pub use bytes::{Bytes, BytesMut}; +pub use bytes; #[cfg(feature = "encryption")] #[cfg_attr(feature = "docs", doc(cfg(encryption)))] pub use matrix_sdk_base::crypto::{EncryptionInfo, LocalTrust}; @@ -85,23 +85,8 @@ pub use matrix_sdk_base::{ }; pub use matrix_sdk_common::*; pub use reqwest; -#[cfg(feature = "appservice")] -pub use ruma::{ - api::{appservice as api_appservice, IncomingRequest, OutgoingRequestAppserviceExt}, - serde::{exports::serde::de::value::Error as SerdeError, urlencoded}, -}; -pub use ruma::{ - api::{ - client as api, - error::{ - FromHttpRequestError, FromHttpResponseError, IntoHttpError, MatrixError, ServerError, - }, - AuthScheme, EndpointError, IncomingResponse, OutgoingRequest, SendAccessToken, - }, - assign, directory, encryption, events, identifiers, int, presence, push, receipt, - serde::{CanonicalJsonValue, Raw}, - thirdparty, uint, Int, MilliSecondsSinceUnixEpoch, Outgoing, SecondsSinceUnixEpoch, UInt, -}; +#[doc(no_inline)] +pub use ruma; mod client; mod error; diff --git a/matrix_sdk/src/room/common.rs b/matrix_sdk/src/room/common.rs index f8709b66..2b29f1bc 100644 --- a/matrix_sdk/src/room/common.rs +++ b/matrix_sdk/src/room/common.rs @@ -79,7 +79,7 @@ impl Common { /// ```no_run /// # use futures::executor::block_on; /// # use matrix_sdk::Client; - /// # use matrix_sdk::identifiers::room_id; + /// # use matrix_sdk::ruma::room_id; /// # use matrix_sdk::media::MediaFormat; /// # use url::Url; /// # let homeserver = Url::parse("http://example.com").unwrap(); @@ -118,9 +118,11 @@ impl Common { /// ```no_run /// # use std::convert::TryFrom; /// use matrix_sdk::Client; - /// # use matrix_sdk::identifiers::room_id; - /// # use matrix_sdk::api::r0::filter::RoomEventFilter; - /// # use matrix_sdk::api::r0::message::get_message_events::Request as MessagesRequest; + /// # use matrix_sdk::ruma::room_id; + /// # use matrix_sdk::ruma::api::client::r0::{ + /// # filter::RoomEventFilter, + /// # message::get_message_events::Request as MessagesRequest, + /// # }; /// # use url::Url; /// /// # let homeserver = Url::parse("http://example.com").unwrap(); diff --git a/matrix_sdk/src/room/joined.rs b/matrix_sdk/src/room/joined.rs index 3010dd5f..e6fad924 100644 --- a/matrix_sdk/src/room/joined.rs +++ b/matrix_sdk/src/room/joined.rs @@ -159,10 +159,10 @@ impl Joined { /// /// ```no_run /// use std::time::Duration; - /// use matrix_sdk::api::r0::typing::create_typing_event::Typing; + /// use matrix_sdk::ruma::api::client::r0::typing::create_typing_event::Typing; /// # use matrix_sdk::{ /// # Client, SyncSettings, - /// # identifiers::room_id, + /// # ruma::room_id, /// # }; /// # use futures::executor::block_on; /// # use url::Url; @@ -349,9 +349,9 @@ impl Joined { /// # use matrix_sdk::{Client, SyncSettings}; /// # use url::Url; /// # use futures::executor::block_on; - /// # use matrix_sdk::identifiers::room_id; + /// # use matrix_sdk::ruma::room_id; /// # use std::convert::TryFrom; - /// use matrix_sdk::events::{ + /// use matrix_sdk::ruma::events::{ /// AnyMessageEventContent, /// room::message::{MessageEventContent, TextMessageEventContent}, /// }; @@ -431,7 +431,7 @@ impl Joined { /// /// ```no_run /// # use std::{path::PathBuf, fs::File, io::Read}; - /// # use matrix_sdk::{Client, identifiers::room_id}; + /// # use matrix_sdk::{Client, ruma::room_id}; /// # use url::Url; /// # use mime; /// # use futures::executor::block_on; @@ -532,18 +532,17 @@ impl Joined { /// # Example /// /// ```no_run - /// use matrix_sdk::{ + /// use matrix_sdk::ruma::{ /// events::{ /// AnyStateEventContent, /// room::member::{MemberEventContent, MembershipState}, /// }, - /// identifiers::mxc_uri, - /// assign, + /// assign, mxc_uri, /// }; /// # futures::executor::block_on(async { /// # let homeserver = url::Url::parse("http://localhost:8080").unwrap(); /// # let mut client = matrix_sdk::Client::new(homeserver).unwrap(); - /// # let room_id = matrix_sdk::identifiers::room_id!("!test:localhost"); + /// # let room_id = matrix_sdk::ruma::room_id!("!test:localhost"); /// /// let avatar_url = mxc_uri!("mxc://example.org/avatar"); /// let member_event = assign!(MemberEventContent::new(MembershipState::Join), { @@ -591,11 +590,11 @@ impl Joined { /// # futures::executor::block_on(async { /// # let homeserver = url::Url::parse("http://localhost:8080").unwrap(); /// # let mut client = matrix_sdk::Client::new(homeserver).unwrap(); - /// # let room_id = matrix_sdk::identifiers::room_id!("!test:localhost"); + /// # let room_id = matrix_sdk::ruma::room_id!("!test:localhost"); /// # let room = client /// # .get_joined_room(&room_id) /// # .unwrap(); - /// let event_id = matrix_sdk::identifiers::event_id!("$xxxxxx:example.org"); + /// let event_id = matrix_sdk::ruma::event_id!("$xxxxxx:example.org"); /// let reason = Some("Indecent material"); /// room.redact(&event_id, reason, None).await.unwrap(); /// # }) diff --git a/matrix_sdk/src/room_member.rs b/matrix_sdk/src/room_member.rs index 4a6a5fa1..488ffee8 100644 --- a/matrix_sdk/src/room_member.rs +++ b/matrix_sdk/src/room_member.rs @@ -39,7 +39,7 @@ impl RoomMember { /// ```no_run /// # use futures::executor::block_on; /// # use matrix_sdk::Client; - /// # use matrix_sdk::identifiers::room_id; + /// # use matrix_sdk::ruma::room_id; /// # use matrix_sdk::RoomMember; /// # use matrix_sdk::media::MediaFormat; /// # use url::Url; diff --git a/matrix_sdk/src/verification/sas.rs b/matrix_sdk/src/verification/sas.rs index 124b6504..c2e90dfe 100644 --- a/matrix_sdk/src/verification/sas.rs +++ b/matrix_sdk/src/verification/sas.rs @@ -45,7 +45,7 @@ impl SasVerification { /// # use ruma::identifiers::user_id; /// use matrix_sdk::verification::SasVerification; /// use matrix_sdk_base::crypto::AcceptSettings; - /// use matrix_sdk::events::key::verification::ShortAuthenticationString; + /// use matrix_sdk::ruma::events::key::verification::ShortAuthenticationString; /// # let homeserver = Url::parse("http://example.com").unwrap(); /// # let client = Client::new(homeserver).unwrap(); /// # let flow_id = "someID"; diff --git a/matrix_sdk_appservice/examples/appservice_autojoin.rs b/matrix_sdk_appservice/examples/appservice_autojoin.rs index fddba03c..f792f242 100644 --- a/matrix_sdk_appservice/examples/appservice_autojoin.rs +++ b/matrix_sdk_appservice/examples/appservice_autojoin.rs @@ -3,12 +3,14 @@ use std::{convert::TryFrom, env}; use matrix_sdk_appservice::{ matrix_sdk::{ async_trait, - events::{ - room::member::{MemberEventContent, MembershipState}, - SyncStateEvent, - }, - identifiers::UserId, room::Room, + ruma::{ + events::{ + room::member::{MemberEventContent, MembershipState}, + SyncStateEvent, + }, + UserId, + }, EventHandler, }, AppService, AppServiceRegistration, diff --git a/matrix_sdk_appservice/src/lib.rs b/matrix_sdk_appservice/src/lib.rs index 6a7f6347..b4da1e55 100644 --- a/matrix_sdk_appservice/src/lib.rs +++ b/matrix_sdk_appservice/src/lib.rs @@ -89,7 +89,9 @@ use dashmap::DashMap; pub use error::Error; use http::{uri::PathAndQuery, Uri}; pub use matrix_sdk; -use matrix_sdk::{reqwest::Url, Bytes, Client, ClientConfig, EventHandler, HttpError, Session}; +use matrix_sdk::{ + bytes::Bytes, reqwest::Url, Client, ClientConfig, EventHandler, HttpError, Session, +}; use regex::Regex; #[doc(inline)] pub use ruma::api::{appservice as api, appservice::Registration}; diff --git a/matrix_sdk_appservice/src/webserver/warp.rs b/matrix_sdk_appservice/src/webserver/warp.rs index 7c584436..8e105252 100644 --- a/matrix_sdk_appservice/src/webserver/warp.rs +++ b/matrix_sdk_appservice/src/webserver/warp.rs @@ -15,7 +15,7 @@ use std::{net::ToSocketAddrs, result::Result as StdResult}; use futures::TryFutureExt; -use matrix_sdk::Bytes; +use matrix_sdk::{bytes::Bytes, ruma}; use serde::Serialize; use warp::{filters::BoxedFilter, path::FullPath, Filter, Rejection, Reply}; @@ -110,7 +110,7 @@ mod filters { .and(warp::query::raw()) .and_then(|token: String, query: String| async move { let query: Vec<(String, String)> = - matrix_sdk::urlencoded::from_str(&query).map_err(Error::from)?; + ruma::serde::urlencoded::from_str(&query).map_err(Error::from)?; if query.into_iter().any(|(key, value)| key == "access_token" && value == token) { Ok::<(), Rejection>(()) @@ -175,8 +175,8 @@ mod handlers { appservice: AppService, request: http::Request, ) -> StdResult { - let incoming_transaction: matrix_sdk::api_appservice::event::push_events::v1::IncomingRequest = - matrix_sdk::IncomingRequest::try_from_http_request(request).map_err(Error::from)?; + let incoming_transaction: ruma::api::appservice::event::push_events::v1::IncomingRequest = + ruma::api::IncomingRequest::try_from_http_request(request).map_err(Error::from)?; let client = appservice.get_cached_client(None)?; client.receive_transaction(incoming_transaction).map_err(Error::from).await?; diff --git a/matrix_sdk_appservice/tests/tests.rs b/matrix_sdk_appservice/tests/tests.rs index c68e5ad0..23dbd221 100644 --- a/matrix_sdk_appservice/tests/tests.rs +++ b/matrix_sdk_appservice/tests/tests.rs @@ -3,10 +3,12 @@ use std::sync::{Arc, Mutex}; #[cfg(feature = "actix")] use actix_web::{test as actix_test, App as ActixApp, HttpResponse}; use matrix_sdk::{ - api_appservice::Registration, async_trait, - events::{room::member::MemberEventContent, SyncStateEvent}, room::Room, + ruma::{ + api::appservice::Registration, + events::{room::member::MemberEventContent, SyncStateEvent}, + }, ClientConfig, EventHandler, RequestConfig, }; use matrix_sdk_appservice::*;