get_next_media: enumerate() instead of indexing

This commit is contained in:
Alexander Krotov
2020-03-28 02:35:00 +03:00
committed by Alexander Krotov
parent 24aa3c781b
commit 92f1e6da1e

View File

@@ -1738,8 +1738,8 @@ pub fn get_next_media(
msg_type2,
msg_type3,
);
for i in 0..list.len() {
if curr_msg_id == list[i] {
for (i, msg_id) in list.iter().enumerate() {
if curr_msg_id == *msg_id {
match direction {
Direction::Forward => {
if i + 1 < list.len() {