Simplify ruma identifier imports

master
Jonas Platte 2021-06-23 14:48:55 +02:00
parent aabda60e9f
commit 4d5768111d
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
19 changed files with 31 additions and 47 deletions

View File

@ -56,7 +56,7 @@ use mime::{self, Mime};
#[cfg(feature = "sso_login")] #[cfg(feature = "sso_login")]
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use reqwest::header::InvalidHeaderValue; use reqwest::header::InvalidHeaderValue;
use ruma::{api::SendAccessToken, events::AnyMessageEventContent, identifiers::MxcUri}; use ruma::{api::SendAccessToken, events::AnyMessageEventContent, MxcUri};
#[cfg(feature = "sso_login")] #[cfg(feature = "sso_login")]
use tokio::{net::TcpListener, sync::oneshot}; use tokio::{net::TcpListener, sync::oneshot};
#[cfg(feature = "sso_login")] #[cfg(feature = "sso_login")]

View File

@ -38,8 +38,8 @@ use ruma::{
}, },
AnyMessageEventContent, AnyStateEventContent, AnyMessageEventContent, AnyStateEventContent,
}, },
identifiers::{EventId, UserId},
receipt::ReceiptType, receipt::ReceiptType,
EventId, UserId,
}; };
#[cfg(feature = "encryption")] #[cfg(feature = "encryption")]
use tracing::instrument; use tracing::instrument;

View File

@ -42,7 +42,7 @@ impl SasVerification {
/// # use matrix_sdk::Client; /// # use matrix_sdk::Client;
/// # use futures::executor::block_on; /// # use futures::executor::block_on;
/// # use url::Url; /// # use url::Url;
/// # use ruma::identifiers::user_id; /// # use ruma::user_id;
/// use matrix_sdk::verification::SasVerification; /// use matrix_sdk::verification::SasVerification;
/// use matrix_sdk_base::crypto::AcceptSettings; /// use matrix_sdk_base::crypto::AcceptSettings;
/// use matrix_sdk::ruma::events::key::verification::ShortAuthenticationString; /// use matrix_sdk::ruma::events::key::verification::ShortAuthenticationString;

View File

@ -6,10 +6,7 @@ use atty::Stream;
use clap::{App as Argparse, AppSettings as ArgParseSettings, Arg, ArgMatches, SubCommand}; use clap::{App as Argparse, AppSettings as ArgParseSettings, Arg, ArgMatches, SubCommand};
use futures::executor::block_on; use futures::executor::block_on;
use matrix_sdk_base::{RoomInfo, Store}; use matrix_sdk_base::{RoomInfo, Store};
use ruma::{ use ruma::{events::EventType, RoomId, UserId};
events::EventType,
identifiers::{RoomId, UserId},
};
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
use rustyline::{ use rustyline::{
completion::{Completer, Pair}, completion::{Completer, Pair},

View File

@ -28,9 +28,9 @@ use ruma::{
AnyGlobalAccountDataEvent, AnyRoomAccountDataEvent, AnyStrippedStateEvent, AnyGlobalAccountDataEvent, AnyRoomAccountDataEvent, AnyStrippedStateEvent,
AnySyncStateEvent, EventType, AnySyncStateEvent, EventType,
}, },
identifiers::{EventId, MxcUri, RoomId, UserId},
receipt::ReceiptType, receipt::ReceiptType,
serde::Raw, serde::Raw,
EventId, MxcUri, RoomId, UserId,
}; };
use tracing::info; use tracing::info;
@ -562,10 +562,8 @@ impl StateStore for MemoryStore {
mod test { mod test {
use matrix_sdk_test::async_test; use matrix_sdk_test::async_test;
use ruma::{ use ruma::{
api::client::r0::media::get_content_thumbnail::Method, api::client::r0::media::get_content_thumbnail::Method, event_id, mxc_uri,
identifiers::{event_id, mxc_uri, room_id, user_id, UserId}, receipt::ReceiptType, room_id, uint, user_id, UserId,
receipt::ReceiptType,
uint,
}; };
use serde_json::json; use serde_json::json;

View File

@ -903,6 +903,7 @@ mod test {
use matrix_sdk_test::async_test; use matrix_sdk_test::async_test;
use ruma::{ use ruma::{
api::client::r0::media::get_content_thumbnail::Method, api::client::r0::media::get_content_thumbnail::Method,
event_id,
events::{ events::{
room::{ room::{
member::{MemberEventContent, MembershipState}, member::{MemberEventContent, MembershipState},
@ -910,10 +911,11 @@ mod test {
}, },
AnySyncStateEvent, EventType, Unsigned, AnySyncStateEvent, EventType, Unsigned,
}, },
identifiers::{event_id, mxc_uri, room_id, user_id, EventId, UserId}, mxc_uri,
receipt::ReceiptType, receipt::ReceiptType,
room_id,
serde::Raw, serde::Raw,
uint, MilliSecondsSinceUnixEpoch, uint, user_id, EventId, MilliSecondsSinceUnixEpoch, UserId,
}; };
use serde_json::json; use serde_json::json;

View File

@ -12,9 +12,8 @@ use ruma::{
room::member::MemberEventContent, AnySyncRoomEvent, StateEvent, StrippedStateEvent, room::member::MemberEventContent, AnySyncRoomEvent, StateEvent, StrippedStateEvent,
SyncStateEvent, Unsigned, SyncStateEvent, Unsigned,
}, },
identifiers::{DeviceKeyAlgorithm, EventId, RoomId, UserId},
serde::Raw, serde::Raw,
DeviceIdBox, MilliSecondsSinceUnixEpoch, DeviceIdBox, DeviceKeyAlgorithm, EventId, MilliSecondsSinceUnixEpoch, RoomId, UserId,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};

View File

@ -30,9 +30,7 @@ use ruma::{
forwarded_room_key::ForwardedRoomKeyToDeviceEventContent, forwarded_room_key::ForwardedRoomKeyToDeviceEventContent,
room::encrypted::EncryptedEventContent, AnyToDeviceEventContent, room::encrypted::EncryptedEventContent, AnyToDeviceEventContent,
}, },
identifiers::{
DeviceId, DeviceIdBox, DeviceKeyAlgorithm, DeviceKeyId, EventEncryptionAlgorithm, UserId, DeviceId, DeviceIdBox, DeviceKeyAlgorithm, DeviceKeyId, EventEncryptionAlgorithm, UserId,
},
}; };
use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_json::{json, Value}; use serde_json::{json, Value};

View File

@ -21,9 +21,8 @@ use std::{
use futures::future::join_all; use futures::future::join_all;
use matrix_sdk_common::executor::spawn; use matrix_sdk_common::executor::spawn;
use ruma::{ use ruma::{
api::client::r0::keys::get_keys::Response as KeysQueryResponse, api::client::r0::keys::get_keys::Response as KeysQueryResponse, encryption::DeviceKeys,
encryption::DeviceKeys, DeviceId, DeviceIdBox, UserId,
identifiers::{DeviceId, DeviceIdBox, UserId},
}; };
use tracing::{trace, warn}; use tracing::{trace, warn};

View File

@ -30,8 +30,8 @@ use ruma::{
room_key_request::{Action, RequestedKeyInfo, RoomKeyRequestToDeviceEventContent}, room_key_request::{Action, RequestedKeyInfo, RoomKeyRequestToDeviceEventContent},
AnyToDeviceEvent, AnyToDeviceEventContent, ToDeviceEvent, AnyToDeviceEvent, AnyToDeviceEventContent, ToDeviceEvent,
}, },
identifiers::{DeviceId, DeviceIdBox, EventEncryptionAlgorithm, RoomId, UserId},
to_device::DeviceIdOrAllDevices, to_device::DeviceIdOrAllDevices,
DeviceId, DeviceIdBox, EventEncryptionAlgorithm, RoomId, UserId,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use thiserror::Error; use thiserror::Error;

View File

@ -1235,6 +1235,7 @@ pub(crate) mod test {
IncomingResponse, IncomingResponse,
}, },
encryption::OneTimeKey, encryption::OneTimeKey,
event_id,
events::{ events::{
dummy::DummyToDeviceEventContent, dummy::DummyToDeviceEventContent,
room::{ room::{
@ -1244,10 +1245,8 @@ pub(crate) mod test {
AnyMessageEventContent, AnySyncMessageEvent, AnySyncRoomEvent, AnyToDeviceEvent, AnyMessageEventContent, AnySyncMessageEvent, AnySyncRoomEvent, AnyToDeviceEvent,
AnyToDeviceEventContent, SyncMessageEvent, ToDeviceEvent, Unsigned, AnyToDeviceEventContent, SyncMessageEvent, ToDeviceEvent, Unsigned,
}, },
identifiers::{ room_id, uint, user_id, DeviceId, DeviceKeyAlgorithm, DeviceKeyId,
event_id, room_id, user_id, DeviceId, DeviceKeyAlgorithm, DeviceKeyId, UserId, MilliSecondsSinceUnixEpoch, UserId,
},
uint, MilliSecondsSinceUnixEpoch,
}; };
use serde_json::json; use serde_json::json;

View File

@ -37,12 +37,9 @@ use ruma::{
room::encrypted::{EncryptedEventContent, EncryptedEventScheme}, room::encrypted::{EncryptedEventContent, EncryptedEventScheme},
AnyToDeviceEvent, ToDeviceEvent, AnyToDeviceEvent, ToDeviceEvent,
}, },
identifiers::{
DeviceId, DeviceIdBox, DeviceKeyAlgorithm, DeviceKeyId, EventEncryptionAlgorithm, RoomId,
UserId,
},
serde::{CanonicalJsonValue, Raw}, serde::{CanonicalJsonValue, Raw},
UInt, DeviceId, DeviceIdBox, DeviceKeyAlgorithm, DeviceKeyId, EventEncryptionAlgorithm, RoomId, UInt,
UserId,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::{json, Value}; use serde_json::{json, Value};

View File

@ -32,8 +32,8 @@ use ruma::{
}, },
AnySyncRoomEvent, SyncMessageEvent, AnySyncRoomEvent, SyncMessageEvent,
}, },
identifiers::{DeviceKeyAlgorithm, EventEncryptionAlgorithm, RoomId},
serde::Raw, serde::Raw,
DeviceKeyAlgorithm, EventEncryptionAlgorithm, RoomId,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::Value; use serde_json::Value;

View File

@ -28,7 +28,7 @@ use ruma::{
}, },
AnyToDeviceEventContent, EventContent, AnyToDeviceEventContent, EventContent,
}, },
identifiers::{DeviceId, DeviceKeyAlgorithm, UserId}, DeviceId, DeviceKeyAlgorithm, UserId,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::json; use serde_json::json;

View File

@ -56,11 +56,8 @@ pub use memorystore::MemoryStore;
use olm_rs::errors::{OlmAccountError, OlmGroupSessionError, OlmSessionError}; use olm_rs::errors::{OlmAccountError, OlmGroupSessionError, OlmSessionError};
pub use pickle_key::{EncryptedPickleKey, PickleKey}; pub use pickle_key::{EncryptedPickleKey, PickleKey};
use ruma::{ use ruma::{
events::room_key_request::RequestedKeyInfo, events::room_key_request::RequestedKeyInfo, identifiers::Error as IdentifierValidationError,
identifiers::{ DeviceId, DeviceIdBox, DeviceKeyAlgorithm, RoomId, UserId,
DeviceId, DeviceIdBox, DeviceKeyAlgorithm, Error as IdentifierValidationError, RoomId,
UserId,
},
}; };
use serde_json::Error as SerdeError; use serde_json::Error as SerdeError;
use thiserror::Error; use thiserror::Error;

View File

@ -757,9 +757,8 @@ mod test {
use matrix_sdk_test::async_test; use matrix_sdk_test::async_test;
use olm_rs::outbound_group_session::OlmOutboundGroupSession; use olm_rs::outbound_group_session::OlmOutboundGroupSession;
use ruma::{ use ruma::{
encryption::SignedKey, encryption::SignedKey, events::room_key_request::RequestedKeyInfo, room_id, user_id,
events::room_key_request::RequestedKeyInfo, DeviceId, EventEncryptionAlgorithm, UserId,
identifiers::{room_id, user_id, DeviceId, EventEncryptionAlgorithm, UserId},
}; };
use tempfile::tempdir; use tempfile::tempdir;

View File

@ -33,9 +33,8 @@ use ruma::{
room::message::{KeyVerificationRequestEventContent, MessageType}, room::message::{KeyVerificationRequestEventContent, MessageType},
AnyMessageEvent, AnyMessageEventContent, AnyToDeviceEvent, AnyToDeviceEventContent, AnyMessageEvent, AnyMessageEventContent, AnyToDeviceEvent, AnyToDeviceEventContent,
}, },
identifiers::{DeviceId, RoomId, UserId},
serde::CanonicalJsonValue, serde::CanonicalJsonValue,
MilliSecondsSinceUnixEpoch, DeviceId, MilliSecondsSinceUnixEpoch, RoomId, UserId,
}; };
use super::FlowId; use super::FlowId;

View File

@ -33,7 +33,7 @@ use ruma::{
}, },
AnyMessageEventContent, AnyToDeviceEventContent, AnyMessageEventContent, AnyToDeviceEventContent,
}, },
identifiers::{DeviceIdBox, DeviceKeyAlgorithm, UserId}, DeviceIdBox, DeviceKeyAlgorithm, UserId,
}; };
use thiserror::Error; use thiserror::Error;
@ -696,7 +696,7 @@ mod test {
use matrix_qrcode::QrVerificationData; use matrix_qrcode::QrVerificationData;
use matrix_sdk_test::async_test; use matrix_sdk_test::async_test;
use ruma::identifiers::{event_id, room_id, user_id, DeviceIdBox, UserId}; use ruma::{event_id, room_id, user_id, DeviceIdBox, UserId};
use crate::{ use crate::{
olm::{PrivateCrossSigningIdentity, ReadOnlyAccount}, olm::{PrivateCrossSigningIdentity, ReadOnlyAccount},

View File

@ -1,6 +1,6 @@
use std::convert::TryFrom; use std::convert::TryFrom;
use ruma::{events::AnyRoomEvent, identifiers::room_id}; use ruma::{events::AnyRoomEvent, room_id};
use serde_json::Value; use serde_json::Value;
use crate::{test_json, EventsJson}; use crate::{test_json, EventsJson};