Unnamed repository; edit this file 'description' to name the repository.
Merge pull request rust-analyzer/text-size#9 from CAD97/textsize-fmt
Remove Display for TextSize
| -rw-r--r-- | lib/text-size/src/range.rs | 2 | ||||
| -rw-r--r-- | lib/text-size/src/size.rs | 8 |
2 files changed, 2 insertions, 8 deletions
diff --git a/lib/text-size/src/range.rs b/lib/text-size/src/range.rs index 7fb4987149..e70a7b6a33 100644 --- a/lib/text-size/src/range.rs +++ b/lib/text-size/src/range.rs @@ -37,7 +37,7 @@ pub struct TextRange { impl fmt::Debug for TextRange { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "[{}..{})", self.start(), self.end()) + write!(f, "[{}..{})", self.start().raw, self.end().raw) } } diff --git a/lib/text-size/src/size.rs b/lib/text-size/src/size.rs index a51a279e9e..93cbcf8579 100644 --- a/lib/text-size/src/size.rs +++ b/lib/text-size/src/size.rs @@ -32,13 +32,7 @@ pub(crate) const fn TextSize(raw: u32) -> TextSize { impl fmt::Debug for TextSize { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(self, f) - } -} - -impl fmt::Display for TextSize { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(&self.raw, f) + write!(f, "{}", self.raw) } } |