From 8953d413fd3c334df708ae33e20974c842de3ca8 Mon Sep 17 00:00:00 2001 From: "Christopher N. Hesse" Date: Thu, 8 Aug 2024 10:41:23 +0200 Subject: [PATCH] Fix clippy lints Signed-off-by: Christopher N. Hesse --- examples/glium.rs | 4 ++-- src/v4l2/api.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/glium.rs b/examples/glium.rs index c14f6a3..07ec38c 100644 --- a/examples/glium.rs +++ b/examples/glium.rs @@ -28,7 +28,7 @@ fn main() -> io::Result<()> { let dev = RwLock::new(Device::with_path(path)?); { - let dev = dev.write().unwrap(); + let dev = dev.read().unwrap(); format = dev.format()?; params = dev.params()?; @@ -126,7 +126,7 @@ fn main() -> io::Result<()> { let (tx, rx) = mpsc::channel(); thread::spawn(move || { - let dev = dev.write().unwrap(); + let dev = dev.read().unwrap(); // Setup a buffer stream let mut stream = MmapStream::with_buffers(&dev, Type::VideoCapture, buffer_count).unwrap(); diff --git a/src/v4l2/api.rs b/src/v4l2/api.rs index 19b834f..70d3ff8 100644 --- a/src/v4l2/api.rs +++ b/src/v4l2/api.rs @@ -270,7 +270,7 @@ pub unsafe fn mmap( offset: libc::off_t, ) -> io::Result<*mut std::os::raw::c_void> { let ret = detail::mmap(start, length, prot, flags, fd, offset); - if ret as usize == std::usize::MAX { + if ret as usize == usize::MAX { Err(io::Error::last_os_error()) } else { Ok(ret)