Skip to content

Commit

Permalink
example/atomic_modeset: Don't panic if all planes are "better"
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Jan 6, 2025
1 parent b65efbc commit 4286f2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/atomic_modeset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ pub fn main() {
}
false
});
let plane = *better_planes.first().unwrap_or(&compatible_planes[0]);
let plane = *better_planes
.first()
.unwrap_or_else(|| &compatible_planes[0]);

println!("{:#?}", mode);
println!("{:#?}", fb);
Expand Down

0 comments on commit 4286f2e

Please sign in to comment.