diff options
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/eco.rs | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/src/util/eco.rs b/src/util/eco.rs index 207f1753..b44214bd 100644 --- a/src/util/eco.rs +++ b/src/util/eco.rs @@ -163,6 +163,24 @@ impl EcoString { } } +impl Default for EcoString { + fn default() -> Self { + Self::new() + } +} + +impl Display for EcoString { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + Display::fmt(self.as_str(), f) + } +} + +impl Debug for EcoString { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + Debug::fmt(self.as_str(), f) + } +} + impl Deref for EcoString { type Target = str; @@ -183,24 +201,6 @@ impl Deref for EcoString { } } -impl Default for EcoString { - fn default() -> Self { - Self::new() - } -} - -impl Display for EcoString { - fn fmt(&self, f: &mut Formatter) -> fmt::Result { - Display::fmt(self.as_str(), f) - } -} - -impl Debug for EcoString { - fn fmt(&self, f: &mut Formatter) -> fmt::Result { - Debug::fmt(self.as_str(), f) - } -} - impl Eq for EcoString {} impl PartialEq for EcoString { @@ -301,12 +301,6 @@ impl From<EcoString> for String { } } -impl From<&EcoString> for String { - fn from(s: &EcoString) -> Self { - s.as_str().to_owned() - } -} - #[cfg(test)] mod tests { use super::*; |
