The value of `token` will sometimes need to be normalized by the caller in order for lookups to work as expected. We do not normalize the token here because some searches, e.g., of urls, are more sensitive to normalization, and so we omit it in those cases.
(&self, token: &Phrase)
| 492 | // to work as expected. We do not normalize the token here because some searches, e.g., |
| 493 | // of urls, are more sensitive to normalization, and so we omit it in those cases. |
| 494 | fn index_key(&self, token: &Phrase) -> Result<IndexKey> { |
| 495 | if !token.is_valid() { |
| 496 | return Err(Error::Repo(format!("a valid token is required: {token}"))); |
| 497 | } |
| 498 | |
| 499 | match token.basename() { |
| 500 | Some(basename) => Ok(IndexKey { |
| 501 | repo_id: self.prefix(), |
| 502 | basename, |
| 503 | }), |
| 504 | None => Err(Error::Repo(format!("bad token: {token}"))), |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | fn prefix(&self) -> RepoId; |
| 509 | } |
no test coverage detected