ephemeris_documents/yaml/source/read/
bounds.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub(super) struct Bounds {
6 pub(super) start: usize,
7 pub(super) end: usize,
8}
9
10impl Bounds {
11 pub(super) const fn new(start: usize, end: usize) -> Self {
12 Self { start, end }
13 }
14
15 pub(super) fn cover(self, other: Self) -> Self {
17 Self {
18 start: self.start.min(other.start),
19 end: self.end.max(other.end),
20 }
21 }
22
23 pub(super) const fn is_empty(self) -> bool {
24 self.start == self.end
25 }
26}