1
Fork 0

Use special Debug format when start > end

This commit is contained in:
Andreas Liljeqvist 2021-08-29 09:58:23 +02:00
parent f5d8749f85
commit da92cd6dcf

View file

@ -784,7 +784,11 @@ impl WrappingRange {
impl fmt::Debug for WrappingRange {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(fmt, "{}..={}", self.start, self.end)?;
if self.start > self.end {
write!(fmt, "(..={}) | ({}..)", self.end, self.start)?;
} else {
write!(fmt, "{}..={}", self.start, self.end)?;
}
Ok(())
}
}