From 11a1a5483f4719b9ba5fb8989d06fa4fdde7cc59 Mon Sep 17 00:00:00 2001 From: Ryan Zoeller Date: Sat, 25 Nov 2023 21:02:46 -0600 Subject: [PATCH] Apply #[must_use] to RawPriorityInheritingLock::new() and gettid() --- CHANGELOG.md | 5 +++++ src/lib.rs | 2 ++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a4affc..07760ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [Unreleased] - ReleaseDate + +- Updated MSRV to 1.65.0. +- Mark `RawPriorityInheritingLock::new()` and `gettid()` as `#[must_use]`. + ## [0.2.3] - 2023-06-09 - Updated `linux-futex` dependency to 0.2.0. diff --git a/src/lib.rs b/src/lib.rs index c62eee0..a3d934d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,6 +22,7 @@ pub struct RawPriorityInheritingLock(linux_futex::PiFutex); impl RawPriorityInheritingLock { /// Create a new, unlocked `RawPriorityInheritingLock`. + #[must_use] pub const fn new() -> Self { Self(linux_futex::PiFutex::new(0)) } @@ -144,6 +145,7 @@ pub type SharedPriorityInheritingLockGuard<'a, T> = /// Safe wrapper around `gettid`. /// /// `gettid` is always successful on Linux. +#[must_use] pub fn gettid() -> libc::pid_t { unsafe { libc::gettid() } }