Browse Source

cargo clippy

pull/1494/head
o2sh 12 months ago
parent
commit
1b073785ac
No known key found for this signature in database
GPG Key ID: E68B161DA72A5D7C
  1. 4
      ascii/src/lib.rs
  2. 4
      build.rs

4
ascii/src/lib.rs

@ -97,7 +97,7 @@ fn get_min_start_max_end(lines: &[&str]) -> (usize, usize) {
/// Produces a series of lines which have been automatically truncated to the /// Produces a series of lines which have been automatically truncated to the
/// correct width /// correct width
impl<'a> Iterator for AsciiArt<'a> { impl Iterator for AsciiArt<'_> {
type Item = String; type Item = String;
fn next(&mut self) -> Option<String> { fn next(&mut self) -> Option<String> {
self.content self.content
@ -136,7 +136,7 @@ impl Token {
/// An iterator over tokens found within the *.ascii format. /// An iterator over tokens found within the *.ascii format.
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
struct Tokens<'a>(&'a str); struct Tokens<'a>(&'a str);
impl<'a> Iterator for Tokens<'a> { impl Iterator for Tokens<'_> {
type Item = Token; type Item = Token;
fn next(&mut self) -> Option<Token> { fn next(&mut self) -> Option<Token> {
let (s, tok) = color_token(self.0) let (s, tok) = color_token(self.0)

4
build.rs

@ -44,9 +44,9 @@ fn strip_color_tokens_filter(
tera::Value::String(s) => s, tera::Value::String(s) => s,
_ => return Err(tera::Error::msg("expected string")), _ => return Err(tera::Error::msg("expected string")),
}; };
return Ok(tera::Value::String( Ok(tera::Value::String(
COLOR_INDEX_REGEX.replace_all(s, "").to_string(), COLOR_INDEX_REGEX.replace_all(s, "").to_string(),
)); ))
} }
fn hex_to_rgb_filter( fn hex_to_rgb_filter(

Loading…
Cancel
Save