diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-09 17:57:36 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-09 17:57:36 -0800 |
commit | 181d80073a88ccce6925dd5663bb2c5c716d6e54 (patch) | |
tree | d2644ba834e4b841daf379b3bba96a64e89493b6 /rust | |
parent | 20cc3a7631d59dc80d5c6783b05af82f5b099f25 (diff) | |
download | fatcat-181d80073a88ccce6925dd5663bb2c5c716d6e54.tar.gz fatcat-181d80073a88ccce6925dd5663bb2c5c716d6e54.zip |
implement Display (not ToString) for FatCatId
Diffstat (limited to 'rust')
-rw-r--r-- | rust/src/identifiers.rs | 8 |
1 files 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())) } } |