From 8e0fd4aa025a8de114eb466ffe8fab8531198bfa Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Thu, 3 Oct 2024 18:25:07 +0000 Subject: [PATCH] adjust lints --- src/file.rs | 1 + src/lib.rs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/file.rs b/src/file.rs index 136fca4..a3c1e16 100644 --- a/src/file.rs +++ b/src/file.rs @@ -358,6 +358,7 @@ impl<'a> SealOptions<'a> { /// /// If the file doesn't support sealing (or `fcntl(2)` otherwise returns an error), this method /// returns `false`. + #[must_use] pub fn is_sealed(&self, file: &File) -> bool { self.is_sealed_inner(file).unwrap_or(false) } diff --git a/src/lib.rs b/src/lib.rs index 2fa132c..ca03828 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,10 +29,11 @@ missing_copy_implementations, missing_debug_implementations, missing_docs, - rust_2018_idioms + rust_2018_idioms, + unsafe_op_in_unsafe_fn )] #![warn(clippy::pedantic)] -#![allow(clippy::must_use_candidate, clippy::needless_doctest_main)] +#![allow(clippy::needless_doctest_main)] #[cfg(not(any(target_os = "linux", target_os = "android")))] compile_error!("pentacle only works on linux or android"); @@ -86,6 +87,7 @@ pub fn ensure_sealed() -> Result<(), Error> { /// Verify whether the currently running program is a sealed anonymous file. /// /// This function returns `false` if opening `/proc/self/exe` fails. +#[must_use] pub fn is_sealed() -> bool { File::open("/proc/self/exe") .map(|f| OPTIONS.is_sealed(&f))