mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-25 02:08:30 +02: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;
|
const TEXT_PREVIEW_LENGTH: usize = 50;
|
||||||
|
|
||||||
fn maybe_truncate(value: &str) -> Option<String> {
|
fn maybe_truncate(value: &str) -> Option<String> {
|
||||||
let mut char_count = 0;
|
for (char_count, (idx, _)) in value.char_indices().enumerate() {
|
||||||
|
|
||||||
for (idx, _) in value.char_indices() {
|
|
||||||
if char_count == TEXT_PREVIEW_LENGTH {
|
if char_count == TEXT_PREVIEW_LENGTH {
|
||||||
return Some(value[..idx].to_string());
|
return Some(value[..idx].to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
char_count += 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
None
|
None
|
||||||
|
|||||||
Reference in New Issue
Block a user