From a4aa58f7bec594784af0225e7ba10399b18d2f00 Mon Sep 17 00:00:00 2001 From: faumaray Date: Tue, 20 Oct 2026 19:46:50 +0300 Subject: [PATCH] Count the sample chat's ids with zip instead of a loop counter Newer clippy (nightly) reports explicit_counter_loop for the sample messages' id in dev.rs, which failed `cargo clippy -D warnings` on nightly for voelin-ui. Same ids, 1 upwards. Co-Authored-By: Claude Sonnet 5.5 --- crates/voelin-ui/src/dev.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/voelin-ui/src/dev.rs b/crates/voelin-ui/src/dev.rs index a33b438..597d088 100644 --- a/crates/voelin-ui/src/dev.rs +++ b/crates/voelin-ui/src/dev.rs @@ -1634,9 +1634,8 @@ fn demo_chat(app: &mut App, session: u64) { None, ), ]; - let mut id = 1; let mut pinned: Vec = Vec::new(); - for (chat, author, client, text, ago, relay, reactions, pin, topic) in lines { + for (id, (chat, author, client, text, ago, relay, reactions, pin, topic)) in (1..).zip(lines) { let target = if chat == DEMO { ChatTarget::Channel(2) } else { ChatTarget::Server }; let message = HistoryMessage { id, @@ -1667,7 +1666,6 @@ fn demo_chat(app: &mut App, session: u64) { source: HistorySource::Gateway, complete: false, }); - id += 1; } // A server chat besides the channel chat. app.handle_event(Event::ChatHistory {