Skip to content

Commit

Permalink
Appeased clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-potter committed Jan 21, 2024
1 parent c9227e2 commit c8a32f5
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 15 deletions.
3 changes: 1 addition & 2 deletions harper-core/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion harper-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions harper-core/src/linting/lint_set.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
4 changes: 1 addition & 3 deletions harper-core/src/linting/wrong_quotes.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/parsing/mod.rs
Original file line number Diff line number Diff line change
@@ -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};
2 changes: 1 addition & 1 deletion harper-core/src/spell/hunspell/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion harper-ls/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions harper-ls/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down

0 comments on commit c8a32f5

Please sign in to comment.