sync: Add #[must_use] to the Mutex guard.

This helps people remember to save the return value to keep the mutex
locked as appropriate.
This commit is contained in:
Huon Wilson 2014-02-15 12:53:23 +11:00
parent 0937f65999
commit 0f4294b4e2

View file

@ -143,6 +143,7 @@ pub struct StaticMutex {
/// An RAII implementation of a "scoped lock" of a mutex. When this structure is
/// dropped (falls out of scope), the lock will be unlocked.
#[must_use]
pub struct Guard<'a> {
priv lock: &'a mut StaticMutex,
}