mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +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 {
|
match direction {
|
||||||
Direction::Forward => {
|
Direction::Forward => {
|
||||||
if i + 1 < list.len() {
|
if i + 1 < list.len() {
|
||||||
ret = Some(list[i + 1]);
|
ret = list.get(i + 1).copied();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Direction::Backward => {
|
Direction::Backward => {
|
||||||
if i >= 1 {
|
if i >= 1 {
|
||||||
ret = Some(list[i - 1]);
|
ret = list.get(i - 1).copied();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user