From 24028ea2000204fdbc210fdebba4909fac11eef6 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 3 Nov 2023 11:48:56 -0700 Subject: [PATCH] Fix `nightly` clippy lints in examples --- examples/atomic_modeset.rs | 6 +++--- examples/legacy_modeset.rs | 4 ++-- examples/utils/mod.rs | 3 --- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/atomic_modeset.rs b/examples/atomic_modeset.rs index 5f16ebc7..56000ee0 100644 --- a/examples/atomic_modeset.rs +++ b/examples/atomic_modeset.rs @@ -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; @@ -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); diff --git a/examples/legacy_modeset.rs b/examples/legacy_modeset.rs index a08f1394..204e6d5d 100644 --- a/examples/legacy_modeset.rs +++ b/examples/legacy_modeset.rs @@ -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; diff --git a/examples/utils/mod.rs b/examples/utils/mod.rs index 172747ae..2001fbe6 100644 --- a/examples/utils/mod.rs +++ b/examples/utils/mod.rs @@ -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);