From ce2529fa9d78f6a8111660cf9fa43dd8368e79c7 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Fri, 5 Mar 2021 16:34:29 -0500 Subject: [PATCH] fix lints --- src/file.rs | 10 +++++++++- src/lib.rs | 1 - src/parser.rs | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/file.rs b/src/file.rs index b632628..c10c191 100644 --- a/src/file.rs +++ b/src/file.rs @@ -73,6 +73,10 @@ pub struct MutableValue<'borrow, 'lookup, 'event> { impl MutableValue<'_, '_, '_> { /// Returns the actual value. This is computed each time this is called, so /// it's best to reuse this value or own it if an allocation is acceptable. + /// + /// # Errors + /// + /// Returns an error if the lookup failed. pub fn value(&self) -> Result, GitConfigError> { let mut found_key = false; let mut latest_value = None; @@ -144,6 +148,10 @@ pub struct MutableMultiValue<'borrow, 'lookup, 'event> { impl<'event> MutableMultiValue<'_, '_, 'event> { /// Returns the actual values. This is computed each time this is called. + /// + /// # Errors + /// + /// Returns an error if the lookup failed. pub fn value(&self) -> Result>, GitConfigError> { let mut found_key = false; let mut values = vec![]; @@ -255,7 +263,7 @@ impl<'event> MutableMultiValue<'_, '_, 'event> { /// Sets all values in this multivar to the provided one by copying the /// input for all values. #[inline] - pub fn set_string_all(&mut self, input: String) { + pub fn set_string_all(&mut self, input: &str) { self.set_owned_values_all(input.as_bytes()) } diff --git a/src/lib.rs b/src/lib.rs index fe5d989..0d899c6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,6 @@ #![forbid(unsafe_code)] #![deny(missing_docs)] #![warn(clippy::pedantic, clippy::nursery, clippy::cargo)] -#![allow(clippy::shadow_unrelated)] //! # `git_config` //! diff --git a/src/parser.rs b/src/parser.rs index 81b0418..c7b7305 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -624,6 +624,7 @@ pub fn parse_from_str(input: &str) -> Result, Error> { /// Returns an error if the string provided is not a valid `git-config`. /// This generally is due to either invalid names or if there's extraneous /// data succeeding valid `git-config` data. +#[allow(clippy::shadow_unrelated)] pub fn parse_from_bytes(input: &[u8]) -> Result, Error> { let mut newlines = 0; let (i, frontmatter) = many0(alt((