1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use super::*;

impl<Idx> Format for core::ops::Range<Idx>
where
    Idx: Format,
{
    fn format(&self, fmt: Formatter) {
        crate::write!(fmt, "{}..{}", self.start, self.end)
    }
}

impl<Idx> Format for core::ops::RangeFrom<Idx>
where
    Idx: Format,
{
    fn format(&self, fmt: Formatter) {
        crate::write!(fmt, "{}..", self.start)
    }
}

impl Format for core::ops::RangeFull {
    fn format(&self, fmt: Formatter) {
        crate::write!(fmt, "..",)
    }
}

impl<Idx> Format for core::ops::RangeInclusive<Idx>
where
    Idx: Format,
{
    fn format(&self, fmt: Formatter) {
        crate::write!(fmt, "{}..={}", self.start(), self.end())
    }
}

impl<Idx> Format for core::ops::RangeTo<Idx>
where
    Idx: Format,
{
    fn format(&self, fmt: Formatter) {
        crate::write!(fmt, "..{}", self.end)
    }
}

impl<Idx> Format for core::ops::RangeToInclusive<Idx>
where
    Idx: Format,
{
    fn format(&self, fmt: Formatter) {
        crate::write!(fmt, "..={}", self.end)
    }
}