MCPcopy Create free account
hub / github.com/chatmail/core / normalize_text

Function normalize_text

src/tools.rs:765–770  ·  view source on GitHub ↗

Returns text for storing in special db columns to make case-insensitive search possible for non-ASCII messages, chat and contact names.

(text: &str)

Source from the content-addressed store, hash-verified

763/// Returns text for storing in special db columns to make case-insensitive search possible for
764/// non-ASCII messages, chat and contact names.
765pub(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)]

Callers 15

set_name_exMethod · 0.85
add_or_lookup_exMethod · 0.85
update_chat_namesFunction · 0.85
do_set_draftMethod · 0.85
update_special_chat_nameFunction · 0.85
get_for_contactMethod · 0.85
save_text_edit_to_dbFunction · 0.85
create_group_exFunction · 0.85

Calls 1

filterMethod · 0.45

Tested by

no test coverage detected