Repository: serenity-rs/serenity (language: rust)

Issue:
implement `Display` for `EmojiIdentifier`
is there a reason that there isnt a `<:{name}:{id}>` `Display` impl?


Discussion / hints:
No reason, as far as I can tell. EmojiIdentifier is definitely printable, because `ReactionType::from(emoji_identifier)` does implement Display

You can PR the Display impl ^^

Fix patch:
diff --git a/src/model/misc.rs b/src/model/misc.rs
index 0a11ea1b5ab..f861b9592dd 100644
--- a/src/model/misc.rs
+++ b/src/model/misc.rs
@@ -4,6 +4,8 @@
 use std::error::Error as StdError;
 use std::fmt;
 #[cfg(all(feature = "model", feature = "utils"))]
+use std::fmt::Write;
+#[cfg(all(feature = "model", feature = "utils"))]
 use std::result::Result as StdResult;
 use std::str::FromStr;
 
@@ -175,6 +177,23 @@ impl EmojiIdentifier {
     }
 }
 
+#[cfg(all(feature = "model", feature = "utils"))]
+impl fmt::Display for EmojiIdentifier {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        if self.animated {
+            f.write_str("<a:")?;
+        } else {
+            f.write_str("<:")?;
+        }
+
+        f.write_str(&self.name)?;
+
+        f.write_char(':')?;
+        fmt::Display::fmt(&self.id, f)?;
+        f.write_char('>')
+    }
+}
+
 #[derive(Debug)]
 #[cfg(all(feature = "model", feature = "utils"))]
 pub struct EmojiIdentifierParseError {


Test patch: