Skip to content

Commit

Permalink
Merge pull request #178 from ids1024/clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix authored Nov 3, 2023
2 parents fd1e350 + 24028ea commit 0c5c8fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/atomic_modeset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ pub fn main() {
.expect("No connected connectors");

// Get the first (usually best) mode
let &mode = con.modes().get(0).expect("No modes found on connector");
let &mode = con.modes().first().expect("No modes found on connector");

let (disp_width, disp_height) = mode.size();

// Find a crtc and FB
let crtc = crtcinfo.get(0).expect("No crtcs found");
let crtc = crtcinfo.first().expect("No crtcs found");

// Select the pixel format
let fmt = DrmFourcc::Xrgb8888;
Expand Down Expand Up @@ -96,7 +96,7 @@ pub fn main() {
}
false
});
let plane = *better_planes.get(0).unwrap_or(&compatible_planes[0]);
let plane = *better_planes.first().unwrap_or(&compatible_planes[0]);

println!("{:#?}", mode);
println!("{:#?}", fb);
Expand Down
4 changes: 2 additions & 2 deletions examples/legacy_modeset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ pub fn main() {
.expect("No connected connectors");

// Get the first (usually best) mode
let &mode = con.modes().get(0).expect("No modes found on connector");
let &mode = con.modes().first().expect("No modes found on connector");

let (disp_width, disp_height) = mode.size();

// Find a crtc and FB
let crtc = crtcinfo.get(0).expect("No crtcs found");
let crtc = crtcinfo.first().expect("No crtcs found");

// Select the pixel format
let fmt = DrmFourcc::Xrgb8888;
Expand Down
3 changes: 0 additions & 3 deletions examples/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
pub use drm::control::Device as ControlDevice;
pub use drm::Device;

pub use drm::control::property::*;
pub use drm::control::ResourceHandle;

#[derive(Debug)]
/// A simple wrapper for a device node.
pub struct Card(std::fs::File);
Expand Down

0 comments on commit 0c5c8fa

Please sign in to comment.