Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: sync: add #[must_use] to Lock::try_lock
The `Lock::try_lock` function returns an `Option<Guard<...>>`, but it currently does not issue a warning if the return value is unused. To avoid potential bugs, the `#[must_use]` annotation is added to ensure proper usage. Note that `T` is `#[must_use]` but `Option<T>` is not. For more context, see: rust-lang/rust#71368. Suggested-by: Alice Ryhl <[email protected]> Link: Rust-for-Linux#1133 Signed-off-by: Jason Devers <[email protected]>
- Loading branch information