Fix newer Clippy warnings for 1.80 (#301)

This commit is contained in:
Jarkko Sakkinen 2024-08-01 06:02:42 +03:00 committed by GitHub
parent d8d8e91295
commit 4fc71c9291
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 41 additions and 38 deletions

View file

@ -5,6 +5,7 @@ use std::collections::hash_map::DefaultHasher;
use std::collections::hash_set;
use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::fmt::{self, Display};
use std::hash::{Hash, Hasher};
use std::ops::{Deref, DerefMut};
@ -1144,9 +1145,9 @@ impl From<RoomMessageEvent> for Message {
}
}
impl ToString for Message {
fn to_string(&self) -> String {
self.event.body().into_owned()
impl Display for Message {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.event.body())
}
}
@ -1423,7 +1424,7 @@ pub mod tests {
"Alt text".to_string(),
"mxc://matrix.org/jDErsDugkNlfavzLTjJNUKAH".into()
)
.info(Some(Box::new(ImageInfo::default())))
.info(Some(Box::default()))
))),
"[Attached Image: Alt text]".to_string()
);