summaryrefslogtreecommitdiff
path: root/src/eval/str.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-08-21 16:38:51 +0200
committerLaurenz <laurmaedje@gmail.com>2021-08-21 17:30:21 +0200
commit0dd4ae0a7ac0c247078df492469ff20b8a90c886 (patch)
tree07a55343b9ccab3fe76b0f1b0de9d1be310d8b14 /src/eval/str.rs
parentf38eb10c2b54bd13ccef119454839f6a66448462 (diff)
Prune derives
Diffstat (limited to 'src/eval/str.rs')
-rw-r--r--src/eval/str.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/eval/str.rs b/src/eval/str.rs
index 1a0e3e1f..a358cd9f 100644
--- a/src/eval/str.rs
+++ b/src/eval/str.rs
@@ -6,7 +6,7 @@ use crate::diag::StrResult;
use crate::util::EcoString;
/// A string value with inline storage and clone-on-write semantics.
-#[derive(Default, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
+#[derive(Default, Clone, Eq, PartialEq, Ord, PartialOrd)]
pub struct Str(EcoString);
impl Str {
@@ -46,6 +46,20 @@ impl Str {
}
}
+impl Deref for Str {
+ type Target = str;
+
+ fn deref(&self) -> &str {
+ self.0.deref()
+ }
+}
+
+impl Debug for Str {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+ Debug::fmt(&self.0, f)
+ }
+}
+
impl Display for Str {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
f.write_char('"')?;
@@ -63,20 +77,6 @@ impl Display for Str {
}
}
-impl Debug for Str {
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- Debug::fmt(&self.0, f)
- }
-}
-
-impl Deref for Str {
- type Target = str;
-
- fn deref(&self) -> &str {
- self.0.deref()
- }
-}
-
impl Add for Str {
type Output = Self;