diff --git a/src/lib.rs b/src/lib.rs index e2683a3..b5522c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -322,6 +322,7 @@ where /// /// The `Strategy` decides whether the scope guard's closure should run. #[inline] + #[must_use] pub fn with_strategy(v: T, dropfn: F) -> ScopeGuard { ScopeGuard { value: ManuallyDrop::new(v), @@ -370,6 +371,7 @@ where /// Create a new `ScopeGuard` owning `v` and with deferred closure `dropfn`. #[inline] +#[must_use] pub fn guard(v: T, dropfn: F) -> ScopeGuard where F: FnOnce(T), @@ -382,6 +384,7 @@ where /// Requires crate feature `use_std`. #[cfg(feature = "use_std")] #[inline] +#[must_use] pub fn guard_on_success(v: T, dropfn: F) -> ScopeGuard where F: FnOnce(T), @@ -418,6 +421,7 @@ where /// ``` #[cfg(feature = "use_std")] #[inline] +#[must_use] pub fn guard_on_unwind(v: T, dropfn: F) -> ScopeGuard where F: FnOnce(T),