From 3be7c1250d171e51f9bff9f173b65a7421e6d516 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Tue, 9 Jan 2024 01:12:12 +0900 Subject: [PATCH] fix: clippy warnings --- src/extensions/transformed.rs | 4 ++-- src/lib.rs | 18 +++++++++--------- src/measure.rs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/extensions/transformed.rs b/src/extensions/transformed.rs index 20d865a..6eadd41 100644 --- a/src/extensions/transformed.rs +++ b/src/extensions/transformed.rs @@ -34,7 +34,7 @@ impl fmt::Display for TransformedExtensions { } pub fn parse_transformed_extensions<'a>( - mut iter: &mut Peekable>, + iter: &mut Peekable>, ) -> Result { // transformed_extensions // https://unicode.org/reports/tr35/#transformed_extensions @@ -73,7 +73,7 @@ pub fn parse_transformed_extensions<'a>( tvalue.push(subtag.to_string()); iter.next(); } else if is_language_subtag(subtag_bytes) { - tlang = Some(parse_unicode_language_id_from_iter(&mut iter)?); + tlang = Some(parse_unicode_language_id_from_iter(iter)?); } else { return Err(ParserError::InvalidSubtag); } diff --git a/src/lib.rs b/src/lib.rs index 6fd6ebe..4a7c933 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,18 +6,18 @@ //! //! ## 🚀 Usages //! -//! ```rust +//! ``` //! use unicode_locale_parser::parse_locale_id; //! -//! fn main() { -//! // simple language -//! let locale = parse_locale_id("ja-JP"); -//! println!("{:#?}", locale); +//! # fn main() { +//! // simple language +//! let locale = parse_locale_id("ja-JP"); +//! println!("{:#?}", locale); //! -//! // language & unicode locale extension -//! let locale = parse_locale_id("de-Latn-DE-u-ca-buddhist"); -//! println!("{:#?}", locale); -//! } +//! // language & unicode locale extension +//! let locale = parse_locale_id("de-Latn-DE-u-ca-buddhist"); +//! println!("{:#?}", locale); +//! # } //! ``` //! //! ## 🤝 API diff --git a/src/measure.rs b/src/measure.rs index b281d9c..7fa2aa0 100644 --- a/src/measure.rs +++ b/src/measure.rs @@ -15,7 +15,7 @@ impl fmt::Display for UnicodeMeasureUnit { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut messages = vec![]; for value in &self.values { - messages.push(format!("{}", value)); + messages.push(value.to_string()); } write!(f, "{}", messages.join(&SEP.to_string()))?; Ok(())