From e5e1414f546510ec705c696329160fa32127ec0c Mon Sep 17 00:00:00 2001 From: Per Stark Date: Wed, 1 Oct 2025 15:39:45 +0200 Subject: [PATCH] chore: clippy magic --- html-router/src/utils/text_content_preview.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/html-router/src/utils/text_content_preview.rs b/html-router/src/utils/text_content_preview.rs index 085d83d..39f0efc 100644 --- a/html-router/src/utils/text_content_preview.rs +++ b/html-router/src/utils/text_content_preview.rs @@ -3,14 +3,10 @@ use common::storage::types::text_content::TextContent; const TEXT_PREVIEW_LENGTH: usize = 50; fn maybe_truncate(value: &str) -> Option { - 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