comments the geoboundingbox + forbid the usage of the lexeme method which could introduce bugs

This commit is contained in:
Tamo 2023-02-06 11:36:49 +01:00
parent fcb09ccc3d
commit d27007005e
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
2 changed files with 17 additions and 1 deletions

View file

@ -88,10 +88,15 @@ impl<'a> Token<'a> {
Self { span, value }
}
/// Returns the string contained in the span of the `Token`.
/// This is only useful in the tests. You should always use
/// the value.
#[cfg(test)]
pub fn lexeme(&self) -> &str {
&self.span
}
/// Return the string contained in the token.
pub fn value(&self) -> &str {
self.value.as_ref().map_or(&self.span, |value| value)
}