mirror of
https://github.com/perstarkse/minne.git
synced 2026-11-13 11:03:29 +01:00
chore: clippy magic
This commit is contained in:
1 parent
fcc49b1954
commit
e5e1414f54
1 file changed
+1
-5
@@ -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