Skip to content

Commit

Permalink
Simplify this loop
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfl0wer committed Sep 5, 2023
1 parent 995ba58 commit 43f1aa1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/types/events/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 43f1aa1

Please sign in to comment.