Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 13, 2023
1 parent cf2913d commit f7e3465
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/css/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Minified<'a>, &'static str> {
pub fn minify(content: &str) -> Result<Minified<'_>, &'static str> {
token::tokenize(content).map(Minified)
}

Expand Down
2 changes: 1 addition & 1 deletion src/css/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ fn fill_other<'a>(
}

#[allow(clippy::comparison_chain)]
pub(super) fn tokenize<'a>(source: &'a str) -> Result<Tokens<'a>, &'static str> {
pub(super) fn tokenize(source: &str) -> Result<Tokens<'_>, &'static str> {
let mut v = Vec::with_capacity(1000);
let mut iterator = source.char_indices().peekable();
let mut start = 0;
Expand Down
7 changes: 1 addition & 6 deletions src/js/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,12 +821,7 @@ fn handle_equal_sign(v: &mut Vec<Token<'_>>, 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() {
Expand Down

0 comments on commit f7e3465

Please sign in to comment.