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
Aleksey Kladov 2020-03-12
parent 4b30753 · parent 9ee15a0 · commit 79435fc
-rw-r--r--lib/text-size/src/range.rs2
-rw-r--r--lib/text-size/src/size.rs8
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)
}
}