diff --git a/roc_std/src/roc_str.rs b/roc_std/src/roc_str.rs index b4c3f143fa..e62965f5bb 100644 --- a/roc_std/src/roc_str.rs +++ b/roc_std/src/roc_str.rs @@ -97,6 +97,18 @@ impl PartialEq for RocStr { impl Eq for RocStr {} +impl PartialOrd for RocStr { + fn partial_cmp(&self, other: &Self) -> Option { + self.as_str().partial_cmp(other.as_str()) + } +} + +impl Ord for RocStr { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.as_str().cmp(other.as_str()) + } +} + impl Debug for RocStr { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.deref().fmt(f)