summaryrefslogtreecommitdiffstats
path: root/src/env.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-12-28 19:09:31 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-12-28 19:09:32 +0100
commitf8331574d0034e08c6326513a58310b7dec153dd (patch)
tree364c0cf8ffd6d949508e3b37b6dccdf5ff37127a /src/env.rs
parent1565ca6ccf4db827c2ab56417916d977c9c4959d (diff)
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 <mail@beyermatthias.de>
Diffstat (limited to 'src/env.rs')
-rw-r--r--src/env.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/env.rs b/src/env.rs
index 854b9a8..065c36b 100644
--- a/src/env.rs
+++ b/src/env.rs
@@ -77,16 +77,19 @@ impl Environment {
}
}
+ #[must_use]
pub fn prefix(mut self, s: &str) -> Self {
self.prefix = Some(s.into());
self
}
+ #[must_use]
pub fn separator(mut self, s: &str) -> Self {
self.separator = Some(s.into());
self
}
+ #[must_use]
pub fn ignore_empty(mut self, ignore: bool) -> Self {
self.ignore_empty = ignore;
self
@@ -94,11 +97,13 @@ impl Environment {
/// Note: enabling `try_parsing` can reduce performance it will try and parse
/// each environment variable 3 times (bool, i64, f64)
+ #[must_use]
pub fn try_parsing(mut self, try_parsing: bool) -> Self {
self.try_parsing = try_parsing;
self
}
+ #[must_use]
pub fn source(mut self, source: Option<Map<String, String>>) -> Self {
self.source = source;
self