From 3f9c4a79a446f66194dc4b5ac8198d7132b7f41d Mon Sep 17 00:00:00 2001 From: Sundog Date: Wed, 18 Oct 2023 14:19:34 -0400 Subject: [PATCH] implement Display for Tag entities rather than to_string --- MODELS.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MODELS.md b/MODELS.md index 6d871e1..a602dee 100644 --- a/MODELS.md +++ b/MODELS.md @@ -77,9 +77,10 @@ impl Tag { name, } } - - pub fn to_string(&self) -> String { - format!("Tag({}::tag::{})", &self.host, &self.name) +} +impl fmt::Display for Tag { + fn format(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}::tag::{}", self.host.as_ref(), self.name.as_ref()) } } ```