From 76b6bd7adca47adbfa953a4b5edc54de1fa16043 Mon Sep 17 00:00:00 2001 From: Marcin Mielniczuk Date: Sun, 14 Apr 2019 10:35:15 +0200 Subject: [PATCH] Mark struct Context as must_use Otherwise calling .context() on a result using ResultExt will not trigger a warning if the result remains unused, e.g. ``` fallible_function().context("bar"); ``` --- src/context.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/context.rs b/src/context.rs index 9ab0cc4..b69be14 100644 --- a/src/context.rs +++ b/src/context.rs @@ -11,6 +11,7 @@ without_std! { /// /// The `Display` impl for `Context` only prints the human-readable context, while the /// `Debug` impl also prints the underlying error. + #[must_use] pub struct Context { context: D, } @@ -73,6 +74,7 @@ with_std! { /// /// The `Display` impl for `Context` only prints the human-readable context, while the /// `Debug` impl also prints the underlying error. + #[must_use] pub struct Context { context: D, failure: Either,