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:
1 parent
9bec557c81
commit
2d71903e8f
2 files changed
+8
-14
No files matched your search
@@ -533,9 +533,8 @@ mod tests {
|
||||
p.channel_groups.insert(id, group(id, &mut n));
|
||||
}
|
||||
// Channels: a tree whose siblings follow each other.
|
||||
let mut next_id = 1;
|
||||
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 order = p
|
||||
.channels
|
||||
@@ -544,8 +543,6 @@ mod tests {
|
||||
.map(|c| c.id)
|
||||
.next_back()
|
||||
.unwrap_or(0);
|
||||
let id = next_id;
|
||||
next_id += 1;
|
||||
parents.push(id);
|
||||
p.channels.insert(
|
||||
id,
|
||||
|
||||
@@ -154,16 +154,13 @@ fn positions(channels: &BTreeMap<ChannelId, ChannelInfo>) -> HashMap<ChannelId,
|
||||
let mut placed: HashSet<ChannelId> = HashSet::new();
|
||||
let mut next = 0;
|
||||
let mut above = 0;
|
||||
loop {
|
||||
// The sibling whose `order` is the one placed last (lowest id first,
|
||||
// so that two claiming the same place do not depend on map order).
|
||||
let Some(channel) = siblings
|
||||
.iter()
|
||||
.filter(|c| c.order == above && !placed.contains(&c.id))
|
||||
.min_by_key(|c| c.id)
|
||||
else {
|
||||
break;
|
||||
};
|
||||
// The sibling whose `order` is the one placed last (lowest id first, so
|
||||
// that two claiming the same place do not depend on map order).
|
||||
while let Some(channel) = siblings
|
||||
.iter()
|
||||
.filter(|c| c.order == above && !placed.contains(&c.id))
|
||||
.min_by_key(|c| c.id)
|
||||
{
|
||||
positions.insert(channel.id, next * 1024);
|
||||
placed.insert(channel.id);
|
||||
above = channel.id;
|
||||
|
||||
Reference in new issue
Block a user