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 23, 2024
1 parent 6039755 commit 2cfd8da
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion harper-core/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fn is_sentence_terminator(punctuation: &Punctuation) -> bool {
#[cfg(test)]
mod tests {
use super::Document;
use crate::{Span, Token, TokenKind};
use crate::Token;

impl Document {
fn from_raw_parts(source: Vec<char>, tokens: Vec<Token>, markdown: bool) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/lint_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ macro_rules! create_simple_builder_methods {
$(
#[doc = "Modifies self, adding the `" $linter "` linter to the set."]
pub fn [<add_$linter:snake>](&mut self) -> &mut Self{
self.linters.push(Box::new($linter::default()));
self.linters.push(Box::<$linter>::default());
self
}
)*
Expand Down
8 changes: 4 additions & 4 deletions harper-core/src/linting/sentence_capitalization.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use itertools::Itertools;

use crate::{document::Document, parsing::TokenStringExt, Dictionary};
use crate::{document::Document, parsing::TokenStringExt};

use super::lint::Suggestion;
use super::{Lint, LintKind, Linter};
Expand Down Expand Up @@ -45,19 +45,19 @@ mod tests {

#[test]
fn catches_basic() {
assert_lint_count("there is no way.", SentenceCapitalization::default(), 1)
assert_lint_count("there is no way.", SentenceCapitalization, 1)
}

#[test]
fn no_period() {
assert_lint_count("there is no way", SentenceCapitalization::default(), 1)
assert_lint_count("there is no way", SentenceCapitalization, 1)
}

#[test]
fn two_sentence() {
assert_lint_count(
"i have complete conviction. she is guilty",
SentenceCapitalization::default(),
SentenceCapitalization,
2,
)
}
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/spell_check.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use hashbrown::{HashMap, HashSet};
use hashbrown::HashMap;

use super::{Lint, LintKind, Linter};
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/wrong_quotes.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{document::Document, Suggestion, Token};

use super::{Lint, LintKind, Linter};
use super::{Lint, Linter};

#[derive(Debug, Clone, Copy, Default)]
pub struct WrongQuotes;
Expand Down
4 changes: 2 additions & 2 deletions harper-ls/src/backend.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{collections::HashMap, fs, ops::DerefMut};
use std::{collections::HashMap, fs};

use harper_core::{Dictionary, Document, LintSet, Linter};
use tokio::{sync::Mutex, time::Instant};
use tokio::sync::Mutex;
use tower_lsp::{
jsonrpc::Result,
lsp_types::{
Expand Down
6 changes: 2 additions & 4 deletions harper-ls/src/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use harper_core::{Lint, Span, Suggestion};
use harper_core::{Lint, Suggestion};
use std::collections::HashMap;
use tower_lsp::lsp_types::{
CodeAction, CodeActionKind, Diagnostic, Position, Range, TextEdit, Url, WorkspaceEdit,
};
use tower_lsp::lsp_types::{CodeAction, CodeActionKind, Diagnostic, TextEdit, Url, WorkspaceEdit};

use crate::pos_conv::span_to_range;

Expand Down

0 comments on commit 2cfd8da

Please sign in to comment.