mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
comments the geoboundingbox + forbid the usage of the lexeme method which could introduce bugs
This commit is contained in:
parent
fcb09ccc3d
commit
d27007005e
2 changed files with 17 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue