1 | use super::*; |
2 | |
3 | impl<Idx> Format for core::ops::Range<Idx> |
4 | where |
5 | Idx: Format, |
6 | { |
7 | fn format(&self, fmt: Formatter) { |
8 | crate::write!(fmt, "{}..{}" , self.start, self.end) |
9 | } |
10 | } |
11 | |
12 | impl<Idx> Format for core::ops::RangeFrom<Idx> |
13 | where |
14 | Idx: Format, |
15 | { |
16 | fn format(&self, fmt: Formatter) { |
17 | crate::write!(fmt, "{}.." , self.start) |
18 | } |
19 | } |
20 | |
21 | impl Format for core::ops::RangeFull { |
22 | fn format(&self, fmt: Formatter) { |
23 | crate::write!(fmt, ".." ,) |
24 | } |
25 | } |
26 | |
27 | impl<Idx> Format for core::ops::RangeInclusive<Idx> |
28 | where |
29 | Idx: Format, |
30 | { |
31 | fn format(&self, fmt: Formatter) { |
32 | crate::write!(fmt, "{}..={}" , self.start(), self.end()) |
33 | } |
34 | } |
35 | |
36 | impl<Idx> Format for core::ops::RangeTo<Idx> |
37 | where |
38 | Idx: Format, |
39 | { |
40 | fn format(&self, fmt: Formatter) { |
41 | crate::write!(fmt, "..{}" , self.end) |
42 | } |
43 | } |
44 | |
45 | impl<Idx> Format for core::ops::RangeToInclusive<Idx> |
46 | where |
47 | Idx: Format, |
48 | { |
49 | fn format(&self, fmt: Formatter) { |
50 | crate::write!(fmt, "..={}" , self.end) |
51 | } |
52 | } |
53 | |