Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

Appeased `clippy`

Elijah Potterc8a32f54b806
diff --git a/harper-core/src/document.rs b/harper-core/src/document.rs
index d569b7492..a1a797ed8 100644
--- a/harper-core/src/document.rs
+++ b/harper-core/src/document.rs
@@ -3,9 +3,8 @@ use std::fmt::Display;
use itertools::Itertools;
use crate::{
- lex_to_end,
linting::{LintSet, Suggestion},
- parsing::lex_to_end_md,
+ parsing::{lex_to_end, lex_to_end_md},
run_lint_set,
span::Span,
Dictionary, FatToken, Lint,
diff --git a/harper-core/src/lib.rs b/harper-core/src/lib.rs
index 980111f41..ab2674a1d 100644
--- a/harper-core/src/lib.rs
+++ b/harper-core/src/lib.rs
@@ -10,7 +10,6 @@ pub use document::Document;
pub use linting::run_lint_set;
pub use linting::LintSet;
pub use linting::{Lint, LintKind, Suggestion};
-pub use parsing::{lex_to_end, lex_to_end_str};
pub use parsing::{FatToken, Punctuation, Token, TokenKind};
pub use span::Span;
pub use spell::Dictionary;
diff --git a/harper-core/src/linting/lint_set.rs b/harper-core/src/linting/lint_set.rs
index d5d0992d7..30db430d0 100644
--- a/harper-core/src/linting/lint_set.rs
+++ b/harper-core/src/linting/lint_set.rs
@@ -1,7 +1,4 @@
-use super::{
- lint::Linter, long_sentences, repeated_words, sentence_capitalization, spell_check,
- unclosed_quotes, wrong_quotes,
-};
+use super::lint::Linter;
use paste::paste;
use super::{
diff --git a/harper-core/src/linting/wrong_quotes.rs b/harper-core/src/linting/wrong_quotes.rs
index 3ab512b83..65d73181a 100644
--- a/harper-core/src/linting/wrong_quotes.rs
+++ b/harper-core/src/linting/wrong_quotes.rs
@@ -1,6 +1,4 @@
-use crate::{
- document::Document, Dictionary, Lint, LintKind, Punctuation, Suggestion, Token, TokenKind,
-};
+use crate::{document::Document, Dictionary, Lint, LintKind, Suggestion, Token};
pub fn wrong_quotes(document: &Document, _dictionary: &Dictionary) -> Vec<Lint> {
document
diff --git a/harper-core/src/parsing/mod.rs b/harper-core/src/parsing/mod.rs
index 9cf67cb1e..cb299dd9b 100644
--- a/harper-core/src/parsing/mod.rs
+++ b/harper-core/src/parsing/mod.rs
@@ -1,5 +1,5 @@
mod lexer;
mod token;
-pub use lexer::{lex_to_end, lex_to_end_md, lex_to_end_md_str, lex_to_end_str};
+pub use lexer::{lex_to_end, lex_to_end_md};
pub use token::{FatToken, Punctuation, Quote, Token, TokenKind, TokenStringExt};
diff --git a/harper-core/src/spell/hunspell/matcher.rs b/harper-core/src/spell/hunspell/matcher.rs
index 14701831e..2525b011b 100644
--- a/harper-core/src/spell/hunspell/matcher.rs
+++ b/harper-core/src/spell/hunspell/matcher.rs
@@ -56,7 +56,7 @@ impl Matcher {
return false;
}
- for (c, op) in chars.into_iter().zip(self.operators.iter()) {
+ for (c, op) in chars.iter().zip(self.operators.iter()) {
if !op.matches(*c) {
return false;
}
diff --git a/harper-ls/src/backend.rs b/harper-ls/src/backend.rs
index 651a7963a..b54a0b35b 100644
--- a/harper-ls/src/backend.rs
+++ b/harper-ls/src/backend.rs
@@ -98,7 +98,7 @@ impl LanguageServer for Backend {
self.publish_diagnostics(&params.text_document.uri).await;
}
- async fn did_close(&self, params: DidCloseTextDocumentParams) {
+ async fn did_close(&self, _params: DidCloseTextDocumentParams) {
self.client
.log_message(MessageType::INFO, "File closed!")
.await;
diff --git a/harper-ls/src/diagnostics.rs b/harper-ls/src/diagnostics.rs
index 9bbacc462..cf7954faa 100644
--- a/harper-ls/src/diagnostics.rs
+++ b/harper-ls/src/diagnostics.rs
@@ -71,8 +71,8 @@ fn lint_to_code_actions<'a>(
}
fn open_url(url: &Url) -> Result<String> {
- let file =
- read(url.path()).map_err(|err| tower_lsp::jsonrpc::Error::new(ErrorCode::InternalError))?;
+ let file = read(url.path())
+ .map_err(|_err| tower_lsp::jsonrpc::Error::new(ErrorCode::InternalError))?;
Ok(String::from_utf8(file).unwrap())
}