mirror of https://github.com/rm-dr/daisy
Minor tweaks
parent
f130bed7aa
commit
07edc4f047
|
@ -15,6 +15,14 @@ impl LineLocation {
|
||||||
pub fn zero(&self) -> bool {
|
pub fn zero(&self) -> bool {
|
||||||
return self.pos == 0 && self.len == 0
|
return self.pos == 0 && self.len == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new_zero() -> LineLocation {
|
||||||
|
return LineLocation { pos: 0, len: 0}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn cut_string<'a>(&self, s: &'a String) -> &'a str {
|
||||||
|
&s[self.pos..self.pos+self.len]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PartialEq for LineLocation {
|
impl PartialEq for LineLocation {
|
||||||
|
|
Loading…
Reference in New Issue