Returns text for storing in special db columns to make case-insensitive search possible for non-ASCII messages, chat and contact names.
(text: &str)
| 763 | /// Returns text for storing in special db columns to make case-insensitive search possible for |
| 764 | /// non-ASCII messages, chat and contact names. |
| 765 | pub(crate) fn normalize_text(text: &str) -> Option<String> { |
| 766 | if text.is_ascii() { |
| 767 | return None; |
| 768 | }; |
| 769 | Some(text.to_lowercase()).filter(|t| t != text) |
| 770 | } |
| 771 | |
| 772 | /// Increments `*t` and checks that it equals to `expected` after that. |
| 773 | #[expect(clippy::arithmetic_side_effects)] |
no test coverage detected