Skip to content

Commit 393d18c

Browse files
toku-sa-nGabrielMajeri
authored andcommitted
fix(GraphicsOutput::modes): iterate over 0..max_mode
1 parent 9f00e70 commit 393d18c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/proto/console/gop.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,10 @@ impl<'gop> Iterator for ModeIter<'gop> {
444444
fn next(&mut self) -> Option<Self::Item> {
445445
let index = self.current;
446446
if index < self.max {
447+
let m = self.gop.query_mode(index).ok().or_else(|| self.next());
447448
self.current += 1;
448449

449-
self.gop.query_mode(index).ok().or_else(|| self.next())
450+
m
450451
} else {
451452
None
452453
}

0 commit comments

Comments
 (0)