From f7e3465b717b0dff95fbf65025c2034c19c1a4d5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 14 Oct 2023 00:05:54 +0200 Subject: [PATCH] Fix clippy lints --- src/css/mod.rs | 2 +- src/css/token.rs | 2 +- src/js/token.rs | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/css/mod.rs b/src/css/mod.rs index 224ad81..70ac410 100644 --- a/src/css/mod.rs +++ b/src/css/mod.rs @@ -18,7 +18,7 @@ mod token; /// let css_minified = minify(css).expect("minification failed"); /// assert_eq!(&css_minified.to_string(), ".foo>p{color:red;}"); /// ``` -pub fn minify<'a>(content: &'a str) -> Result, &'static str> { +pub fn minify(content: &str) -> Result, &'static str> { token::tokenize(content).map(Minified) } diff --git a/src/css/token.rs b/src/css/token.rs index eadff0f..467bed0 100644 --- a/src/css/token.rs +++ b/src/css/token.rs @@ -427,7 +427,7 @@ fn fill_other<'a>( } #[allow(clippy::comparison_chain)] -pub(super) fn tokenize<'a>(source: &'a str) -> Result, &'static str> { +pub(super) fn tokenize(source: &str) -> Result, &'static str> { let mut v = Vec::with_capacity(1000); let mut iterator = source.char_indices().peekable(); let mut start = 0; diff --git a/src/js/token.rs b/src/js/token.rs index 251394c..cbc424c 100644 --- a/src/js/token.rs +++ b/src/js/token.rs @@ -821,12 +821,7 @@ fn handle_equal_sign(v: &mut Vec>, c: ReservedChar) -> bool { true } -fn check_if_number<'a>( - iterator: &mut MyPeekable<'_>, - start: usize, - pos: usize, - source: &'a str, -) -> bool { +fn check_if_number(iterator: &mut MyPeekable<'_>, start: usize, pos: usize, source: &str) -> bool { if source[start..pos].find('.').is_some() { return false; } else if u64::from_str(&source[start..pos]).is_ok() {