defmt/impls/core_/
ops.rs

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