Remove most deprecated items

This commit is contained in:
Jonas Platte 2021-07-03 00:32:32 +02:00
parent d213ee4718
commit 6ee3955483
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
6 changed files with 5 additions and 51 deletions

View File

@ -29,28 +29,4 @@ impl Session {
pub fn new(access_token: String, user_id: UserId, device_id: DeviceIdBox) -> Self {
Self { access_token, identification: Some(Identification { user_id, device_id }) }
}
/// Get the access token associated with this session.
#[deprecated]
pub fn access_token(&self) -> &str {
&self.access_token
}
/// Get the ID of the user the session belongs to.
#[deprecated]
pub fn user_id(&self) -> Option<&UserId> {
if let Some(identification) = &self.identification {
return Some(&identification.user_id);
}
None
}
/// Get ID of the device the session belongs to.
#[deprecated]
pub fn device_id(&self) -> Option<&DeviceId> {
if let Some(identification) = &self.identification {
return Some(&identification.device_id);
}
None
}
}

View File

@ -783,12 +783,6 @@ impl TextMessageEventContent {
pub fn markdown(body: impl AsRef<str> + Into<String>) -> Self {
Self { formatted: FormattedBody::markdown(&body), ..Self::plain(body) }
}
/// A convenience constructor to create a plain text message.
#[deprecated = "Renamed to plain"]
pub fn new_plain(body: impl Into<String>) -> Self {
Self::plain(body)
}
}
/// The payload for a video message.

View File

@ -13,6 +13,7 @@ fn deserialize_initial_state_event() {
}))
.unwrap(),
AnyInitialStateEvent::RoomName(InitialStateEvent { content, state_key})
if content.name() == RoomName::try_from("foo".to_owned()).ok().as_ref() && state_key.is_empty()
if content.name == Some(RoomName::try_from("foo".to_owned()).unwrap())
&& state_key.is_empty()
);
}

View File

@ -96,7 +96,7 @@ fn deserialize_stripped_state_events() {
let event = from_json_value::<AnyStrippedStateEvent>(name_event).unwrap();
match event {
AnyStrippedStateEvent::RoomName(event) => {
assert_eq!(event.content.name(), RoomName::try_from("Ruma".to_owned()).ok().as_ref());
assert_eq!(event.content.name, Some(RoomName::try_from("Ruma".to_owned()).unwrap()));
assert_eq!(event.state_key, "");
assert_eq!(event.sender.to_string(), "@example:localhost");
}

View File

@ -59,14 +59,6 @@ mod server_name;
mod session_id;
mod signatures;
/// Check whether a given string is a valid server name according to [the specification][].
///
/// [the specification]: https://matrix.org/docs/spec/appendices#server-name
#[deprecated = "Use the [`ServerName`](server_name/struct.ServerName.html) type instead."]
pub fn is_valid_server_name(name: &str) -> bool {
<&ServerName>::try_from(name).is_ok()
}
/// Generates a random identifier localpart.
#[cfg(feature = "rand")]
fn generate_localpart(length: usize) -> Box<str> {
@ -148,15 +140,6 @@ macro_rules! room_version_id {
};
}
/// Compile-time checked `ServerSigningKeyId` construction.
#[macro_export]
#[deprecated = "use server_signing_key_id!()"]
macro_rules! server_key_id {
($s:literal) => {
$crate::_macros::server_signing_key_id!($crate, $s)
};
}
/// Compile-time checked `ServerSigningKeyId` construction.
#[macro_export]
macro_rules! server_signing_key_id {

View File

@ -84,8 +84,8 @@ pub use ruma_serde::Outgoing;
#[allow(deprecated)] // Allow re-export of deprecated items
pub use ruma_identifiers::{
device_id, device_key_id, event_id, mxc_uri, room_alias_id, room_id, room_version_id,
server_key_id, server_name, server_signing_key_id, user_id, ClientSecret, ClientSecretBox,
DeviceId, DeviceIdBox, DeviceKeyAlgorithm, DeviceKeyId, DeviceSignatures, DeviceSigningKeyId,
server_name, server_signing_key_id, user_id, ClientSecret, ClientSecretBox, DeviceId,
DeviceIdBox, DeviceKeyAlgorithm, DeviceKeyId, DeviceSignatures, DeviceSigningKeyId,
EntitySignatures, EventEncryptionAlgorithm, EventId, KeyId, KeyName, KeyNameBox, MxcUri,
RoomAliasId, RoomId, RoomIdOrAliasId, RoomVersionId, ServerName, ServerNameBox,
ServerSignatures, ServerSigningKeyId, SessionId, SessionIdBox, Signatures, SigningKeyAlgorithm,