brunoczim / fslock

File locking for Rust.
MIT License
40 stars 11 forks source link

Consider using must_use attribute for some functions #14

Open FrancisRussell opened 12 months ago

FrancisRussell commented 12 months ago

Functions like try_lock and try_lock_with_pid are nonsensical to use without looking at their return value. It feels like these and maybe owns_lock are candidates for the must_use attribute.

brunoczim commented 11 months ago

Hmmm, aren't try_lock and try_lock_with_pid already affected by must_use since they return Result? I am not sure if there is a way to make a nested #[must_use] regarding the Ok(bool) scenario.