Simplify this loop

This commit is contained in:
bitfl0wer 2023-09-05 13:34:22 +02:00
parent 995ba583df
commit 43f1aa1add
No known key found for this signature in database
GPG Key ID: 0ACD574FCF5226CF
1 changed files with 1 additions and 5 deletions

View File

@ -124,11 +124,7 @@ impl UpdateMessage<Guild> for ChannelDelete {
}
for (iteration, item) in (0_u32..).zip(write.channels.as_mut().unwrap().iter()) {
if item.read().unwrap().id == self.id().unwrap() {
write
.channels
.as_mut()
.unwrap()
.swap_remove(iteration as usize);
write.channels.as_mut().unwrap().remove(iteration as usize);
return;
}
}