From 181d80073a88ccce6925dd5663bb2c5c716d6e54 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 9 Jan 2019 17:57:36 -0800 Subject: implement Display (not ToString) for FatCatId --- rust/src/identifiers.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rust/src/identifiers.rs b/rust/src/identifiers.rs index 386570b9..5cfa2fb6 100644 --- a/rust/src/identifiers.rs +++ b/rust/src/identifiers.rs @@ -4,13 +4,15 @@ use regex::Regex; use serde_json; use std::str::FromStr; use uuid::Uuid; +use std::fmt; + #[derive(Clone, Copy, PartialEq, Debug)] pub struct FatCatId(Uuid); -impl ToString for FatCatId { - fn to_string(&self) -> String { - uuid2fcid(&self.to_uuid()) +impl fmt::Display for FatCatId { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", uuid2fcid(&self.to_uuid())) } } -- cgit v1.2.3