mirror of
https://github.com/perstarkse/minne.git
synced 2026-01-11 20:50:24 +01:00
chore: clippy magic
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user