diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2024-03-23 07:51:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-23 11:51:43 +0000 |
| commit | d1568a55831f4074c7bcfe7d0bb983055e1709d3 (patch) | |
| tree | 25007c3b5cba2ecefc318c648030bde5aff55f85 /crates | |
| parent | 0dba0e26587a663e1de66c88d511379fc16d3612 (diff) | |
Let `Repr` for `Relative<T>` print both abs + ratio (#3721)
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst/src/layout/rel.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crates/typst/src/layout/rel.rs b/crates/typst/src/layout/rel.rs index fa2a56e2..ed367588 100644 --- a/crates/typst/src/layout/rel.rs +++ b/crates/typst/src/layout/rel.rs @@ -100,11 +100,7 @@ impl<T: Numeric + Debug> Debug for Rel<T> { impl<T: Numeric + Repr> Repr for Rel<T> { fn repr(&self) -> EcoString { - match (self.rel.is_zero(), self.abs.is_zero()) { - (false, false) => eco_format!("{} + {}", self.rel.repr(), self.abs.repr()), - (false, true) => self.rel.repr(), - (true, _) => self.abs.repr(), - } + eco_format!("{} + {}", self.rel.repr(), self.abs.repr()) } } |
