Add the default help flag

This commit is contained in:
JT
2021-10-14 06:53:27 +13:00
parent ff6cc2cbdd
commit fdd2c35fd9
8 changed files with 89 additions and 41 deletions

View File

@ -10,7 +10,7 @@ where
pub span: Span,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
pub struct Span {
pub start: usize,
pub end: usize,
@ -37,6 +37,10 @@ impl Span {
end: self.end - offset,
}
}
pub fn contains(&self, pos: usize) -> bool {
pos >= self.start && pos < self.end
}
}
pub fn span(spans: &[Span]) -> Span {