diff --git a/src/storage/file/id.rs b/src/storage/file/id.rs index 6d239381..0096fad3 100644 --- a/src/storage/file/id.rs +++ b/src/storage/file/id.rs @@ -108,9 +108,7 @@ impl Debug for FileID { impl Display for FileID { fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { - try!(write!(fmt, "FileID[{:?}]: {:?}", - self.id_type, - self.id)); + try!(write!(fmt, "{}-{}", self.id_type, self.id)); Ok(()) } diff --git a/src/storage/file/id_type.rs b/src/storage/file/id_type.rs index dbb498b6..06c6a1c7 100644 --- a/src/storage/file/id_type.rs +++ b/src/storage/file/id_type.rs @@ -1,3 +1,5 @@ +use std::fmt::{Debug, Display, Formatter}; +use std::fmt; use std::convert::{From, Into}; use std::str::FromStr; @@ -5,7 +7,6 @@ use std::str::FromStr; #[derive(Clone)] #[derive(PartialEq)] #[derive(Eq)] -// #[derive(Display)] #[derive(Hash)] /** * File ID type @@ -39,3 +40,13 @@ impl Into for FileIDType { } } +impl Display for FileIDType { + + fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { + match self { + &FileIDType::UUID => try!(write!(fmt, "UUID")), + } + Ok(()) + } +} +