Write two loops of the seam as newer clippy wants them

A nightly clippy (1.101) flags two places of the session seam that the pinned
1.94 does not: the sibling placement of ts_session/entities.rs is a while let
loop, and the generated channel tree of the presence round trip in book.rs
counts with its loop variable. Neither changes behaviour (the same random
stream, the same ids).

The remaining nightly findings are in code this branch does not touch:
audio.rs and media.rs of voelin-core (chunks_exact), voice.rs (a large Err
variant), voelin-audio, voelin-media and voelin-ui.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-21 02:13:19 +03:00
1 parent 9bec557c81
commit 2d71903e8f
2 files changed
+8 -14

No files matched your search

+1 -4
View File
@@ -533,9 +533,8 @@ mod tests {
p.channel_groups.insert(id, group(id, &mut n)); p.channel_groups.insert(id, group(id, &mut n));
} }
// Channels: a tree whose siblings follow each other. // Channels: a tree whose siblings follow each other.
let mut next_id = 1;
let mut parents = vec![0u64]; let mut parents = vec![0u64];
for _ in 0..(3 + n.below(8)) { for id in 1..=(3 + n.below(8)) {
let parent = parents[n.below(parents.len() as u64) as usize]; let parent = parents[n.below(parents.len() as u64) as usize];
let order = p let order = p
.channels .channels
@@ -544,8 +543,6 @@ mod tests {
.map(|c| c.id) .map(|c| c.id)
.next_back() .next_back()
.unwrap_or(0); .unwrap_or(0);
let id = next_id;
next_id += 1;
parents.push(id); parents.push(id);
p.channels.insert( p.channels.insert(
id, id,
+7 -10
View File
@@ -154,16 +154,13 @@ fn positions(channels: &BTreeMap<ChannelId, ChannelInfo>) -> HashMap<ChannelId,
let mut placed: HashSet<ChannelId> = HashSet::new(); let mut placed: HashSet<ChannelId> = HashSet::new();
let mut next = 0; let mut next = 0;
let mut above = 0; let mut above = 0;
loop { // The sibling whose `order` is the one placed last (lowest id first, so
// The sibling whose `order` is the one placed last (lowest id first, // that two claiming the same place do not depend on map order).
// so that two claiming the same place do not depend on map order). while let Some(channel) = siblings
let Some(channel) = siblings .iter()
.iter() .filter(|c| c.order == above && !placed.contains(&c.id))
.filter(|c| c.order == above && !placed.contains(&c.id)) .min_by_key(|c| c.id)
.min_by_key(|c| c.id) {
else {
break;
};
positions.insert(channel.id, next * 1024); positions.insert(channel.id, next * 1024);
placed.insert(channel.id); placed.insert(channel.id);
above = channel.id; above = channel.id;