Skip to content

Commit

Permalink
Add array From impl for VideoMode, to mirror it being available on Ve…
Browse files Browse the repository at this point in the history
…ctor types
  • Loading branch information
crumblingstatue committed Dec 2, 2024
1 parent 3f26d50 commit 88fefd8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/window/video_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,15 @@ impl VideoMode {

impl From<(u32, u32)> for VideoMode {
/// Constructs a `VideoMode` from `(w, h)`. Bit depth is 32.
fn from(src: (u32, u32)) -> Self {
Self::new(src.0, src.1, 32)
fn from((w, h): (u32, u32)) -> Self {
Self::new(w, h, 32)
}
}

impl From<[u32; 2]> for VideoMode {
/// Constructs a `VideoMode` from `[w, h]`. Bit depth is 32.
fn from([w, h]: [u32; 2]) -> Self {
Self::new(w, h, 32)
}
}

Expand Down

0 comments on commit 88fefd8

Please sign in to comment.