diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3357d9f..6148acd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.52 + toolchain: stable components: clippy override: true - uses: actions-rs/clippy-check@v1 diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 0000000..cef91fd --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +msrv = "1.52" diff --git a/src/error.rs b/src/error.rs index ffd6199..e85971d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -2,7 +2,7 @@ use reqwest::Error as ReqwestError; use std::fmt; #[derive(Debug)] -#[allow(clippy::pub_enum_variant_names)] +#[allow(clippy::enum_variant_names)] pub enum TealdeerError { CacheError(String), ConfigError(String), diff --git a/src/formatter.rs b/src/formatter.rs index 887df6b..f131e93 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -53,10 +53,10 @@ fn format_code(command: &str, text: &str, config: &Config) -> String { let example_code = &between_variables[..variable_start]; let example_variable = &between_variables[variable_start + 2..]; - highlight_command(&command, &example_code, &config, &mut parts); + highlight_command(command, example_code, config, &mut parts); parts.push(config.style.example_variable.paint(example_variable)); } else { - highlight_command(&command, &between_variables, &config, &mut parts); + highlight_command(command, between_variables, config, &mut parts); } } @@ -98,7 +98,7 @@ where .map_err(|e| WriteError(e.to_string()))?; } LineType::ExampleCode(text) => { - writeln!(writer, " {}", &format_code(&command, &text, &config)) + writeln!(writer, " {}", &format_code(&command, &text, config)) .map_err(|e| WriteError(e.to_string()))?; } LineType::Other(text) => debug!("Unknown line type: {:?}", text), diff --git a/src/main.rs b/src/main.rs index 58efc7e..5bcea82 100644 --- a/src/main.rs +++ b/src/main.rs @@ -100,7 +100,7 @@ fn print_page( } else { // Create tokenizer and print output let mut tokenizer = Tokenizer::new(reader); - print_lines(&mut handle, &mut tokenizer, &config) + print_lines(&mut handle, &mut tokenizer, config) .map_err(|e| format!("Could not write to stdout: {}", e.message()))?; }; }