From d40191f48434af9163c2eff1b760ac0303c57733 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 5 May 2024 20:33:39 +0200 Subject: [PATCH] Disallow panicking code via lints --- src/capability.rs | 1 + src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/capability.rs b/src/capability.rs index 835e2e6..f186892 100644 --- a/src/capability.rs +++ b/src/capability.rs @@ -80,6 +80,7 @@ pub struct Capabilities { impl From for Capabilities { fn from(cap: v4l2_capability) -> Self { Self { + // TODO: CStr::from_bytes_until_nul() driver: str::from_utf8(&cap.driver) .unwrap() .trim_matches(char::from(0)) diff --git a/src/lib.rs b/src/lib.rs index fcbe19b..0f4dbd6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,6 +66,7 @@ //!``` //! //! Have a look at the examples to learn more about device and buffer management. +#![deny(clippy::panic, clippy::unwrap_used, clippy::expect_used)] #[cfg(feature = "v4l-sys")] pub use v4l_sys;