mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 13:36:30 +03:00
get_next_media: replace indexing with .get()
This commit is contained in:
committed by
Alexander Krotov
parent
92f1e6da1e
commit
5f574cf283
@@ -1743,12 +1743,12 @@ pub fn get_next_media(
|
||||
match direction {
|
||||
Direction::Forward => {
|
||||
if i + 1 < list.len() {
|
||||
ret = Some(list[i + 1]);
|
||||
ret = list.get(i + 1).copied();
|
||||
}
|
||||
}
|
||||
Direction::Backward => {
|
||||
if i >= 1 {
|
||||
ret = Some(list[i - 1]);
|
||||
ret = list.get(i - 1).copied();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user