From f8331574d0034e08c6326513a58310b7dec153dd Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 28 Dec 2021 19:09:31 +0100 Subject: Add #[must_use] annotations Clippy nightly fails the checks because it wants us to have a `#[must_use]` annotation on functions that return `Self`. So we add these annotations with this patch. Signed-off-by: Matthias Beyer --- src/error.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 84984ba..83ee416 100644 --- a/src/error.rs +++ b/src/error.rs @@ -114,6 +114,7 @@ impl ConfigError { // FIXME: pub(crate) #[doc(hidden)] + #[must_use] pub fn extend_with_key(self, key: &str) -> Self { match self { ConfigError::Type { @@ -132,6 +133,7 @@ impl ConfigError { } } + #[must_use] fn prepend(self, segment: String, add_dot: bool) -> Self { let concat = |key: Option| { let key = key.unwrap_or_else(String::new); @@ -159,10 +161,12 @@ impl ConfigError { } } + #[must_use] pub(crate) fn prepend_key(self, key: String) -> Self { self.prepend(key, true) } + #[must_use] pub(crate) fn prepend_index(self, idx: usize) -> Self { self.prepend(format!("[{}]", idx), false) } -- cgit v1.2.3