Annotate LockedFile with #[must_use]

Standard lock guards have the same annotation, because creating them
without binding them to a local variable is almost always a mistake.
This commit is contained in:
Jack O'Connor 2025-06-20 16:00:13 -07:00
parent 1ff8fc0947
commit 60528e3e25

View file

@ -601,6 +601,7 @@ pub fn is_virtualenv_base(path: impl AsRef<Path>) -> bool {
/// A file lock that is automatically released when dropped.
#[derive(Debug)]
#[must_use]
pub struct LockedFile(fs_err::File);
impl LockedFile {