chore: clippy magic

This commit is contained in:
Per Stark
2025-10-01 15:39:45 +02:00
parent fcc49b1954
commit e5e1414f54

View File

@@ -3,14 +3,10 @@ use common::storage::types::text_content::TextContent;
const TEXT_PREVIEW_LENGTH: usize = 50;
fn maybe_truncate(value: &str) -> Option<String> {
let mut char_count = 0;
for (idx, _) in value.char_indices() {
for (char_count, (idx, _)) in value.char_indices().enumerate() {
if char_count == TEXT_PREVIEW_LENGTH {
return Some(value[..idx].to_string());
}
char_count += 1;
}
None