|
@@ -1,5 +1,6 @@
|
|
//! Event tag
|
|
//! Event tag
|
|
use super::Addr;
|
|
use super::Addr;
|
|
|
|
+use std::fmt::{self, Display};
|
|
|
|
|
|
/// A tag that references another event
|
|
/// A tag that references another event
|
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
|
@@ -26,15 +27,18 @@ pub enum Marker {
|
|
Unknown(String),
|
|
Unknown(String),
|
|
}
|
|
}
|
|
|
|
|
|
-impl ToString for Marker {
|
|
|
|
- fn to_string(&self) -> String {
|
|
|
|
- (match self {
|
|
|
|
- Self::Root => "root",
|
|
|
|
- Self::Reply => "reply",
|
|
|
|
- Self::Mention => "mention",
|
|
|
|
- Self::Unknown(x) => x,
|
|
|
|
- })
|
|
|
|
- .to_owned()
|
|
|
|
|
|
+impl Display for Marker {
|
|
|
|
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
+ write!(
|
|
|
|
+ f,
|
|
|
|
+ "{}",
|
|
|
|
+ match self {
|
|
|
|
+ Self::Root => "root",
|
|
|
|
+ Self::Reply => "reply",
|
|
|
|
+ Self::Mention => "mention",
|
|
|
|
+ Self::Unknown(x) => x,
|
|
|
|
+ }
|
|
|
|
+ )
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|