diff --git a/crates/ruma-common/src/events/room/message/image.rs b/crates/ruma-common/src/events/room/message/image.rs index 19f78f2f..eee0fae6 100644 --- a/crates/ruma-common/src/events/room/message/image.rs +++ b/crates/ruma-common/src/events/room/message/image.rs @@ -133,7 +133,7 @@ impl ImageMessageEventContent { #[cfg(feature = "unstable-msc3552")] file: Some(FileContent::encrypted(file.url.clone(), (&file).into(), None)), #[cfg(feature = "unstable-msc3552")] - image: Some(Box::new(ImageContent::default())), + image: Some(Box::default()), #[cfg(feature = "unstable-msc3552")] thumbnail: None, #[cfg(feature = "unstable-msc3552")] diff --git a/crates/ruma-common/src/events/room/message/video.rs b/crates/ruma-common/src/events/room/message/video.rs index 10329d86..3c586718 100644 --- a/crates/ruma-common/src/events/room/message/video.rs +++ b/crates/ruma-common/src/events/room/message/video.rs @@ -139,7 +139,7 @@ impl VideoMessageEventContent { #[cfg(feature = "unstable-msc3553")] file: Some(FileContent::encrypted(file.url.clone(), (&file).into(), None)), #[cfg(feature = "unstable-msc3553")] - video: Some(Box::new(VideoContent::default())), + video: Some(Box::default()), #[cfg(feature = "unstable-msc3553")] thumbnail: None, #[cfg(feature = "unstable-msc3553")] diff --git a/crates/ruma-common/src/identifiers/user_id.rs b/crates/ruma-common/src/identifiers/user_id.rs index e68d2bbd..5ea50dc8 100644 --- a/crates/ruma-common/src/identifiers/user_id.rs +++ b/crates/ruma-common/src/identifiers/user_id.rs @@ -91,7 +91,7 @@ impl UserId { /// Returns the user's localpart. pub fn localpart(&self) -> &str { - &self.as_str()[1..self.colon_idx() as usize] + &self.as_str()[1..self.colon_idx()] } /// Returns the server name of the user ID.