Skip to content

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

style: clean up some imports (#3179)

Steve Kurch668eac061d95
diff --git a/harper-cli/src/lint.rs b/harper-cli/src/lint.rs
index a13620d8f..e0cc731ba 100644
--- a/harper-cli/src/lint.rs
+++ b/harper-cli/src/lint.rs
@@ -11,11 +11,12 @@ use rayon::prelude::*;
use serde::Serialize;
use harper_core::{
+ Dialect, DictWordMetadata, Document, Token, TokenKind,
linting::{FlatConfig, Lint, LintGroup, LintKind},
parsers::MarkdownOptions,
+ remove_overlaps_map,
spell::{Dictionary, MergedDictionary, MutableDictionary},
weirpack::Weirpack,
- {Dialect, DictWordMetadata, Document, Token, TokenKind, remove_overlaps_map},
};
use crate::input::{
diff --git a/harper-core/src/spell/fst_dictionary.rs b/harper-core/src/spell/fst_dictionary.rs
index 41e306d97..70c0fa9c4 100644
--- a/harper-core/src/spell/fst_dictionary.rs
+++ b/harper-core/src/spell/fst_dictionary.rs
@@ -1,16 +1,16 @@
-use super::{MutableDictionary, WordId};
+use std::{
+ borrow::Cow,
+ cell::RefCell,
+ sync::{Arc, LazyLock},
+};
+
use fst::{IntoStreamer, Map as FstMap, Streamer, map::StreamWithState};
use hashbrown::HashMap;
use levenshtein_automata::{DFA, LevenshteinAutomatonBuilder};
-use std::borrow::Cow;
-use std::sync::LazyLock;
-use std::{cell::RefCell, sync::Arc};
+use super::{Dictionary, FuzzyMatchResult, MutableDictionary, WordId};
use crate::{CharString, CharStringExt, DictWordMetadata};
-use super::Dictionary;
-use super::FuzzyMatchResult;
-
/// An immutable dictionary allowing for very fast spellchecking.
///
/// For dictionaries with changing contents, such as user and file dictionaries, prefer
diff --git a/harper-core/src/spell/merged_dictionary.rs b/harper-core/src/spell/merged_dictionary.rs
index b18436c87..2bd497e01 100644
--- a/harper-core/src/spell/merged_dictionary.rs
+++ b/harper-core/src/spell/merged_dictionary.rs
@@ -5,8 +5,7 @@ use std::sync::Arc;
use foldhash::quality::FixedState;
use itertools::Itertools;
-use super::{FstDictionary, WordId};
-use super::{FuzzyMatchResult, dictionary::Dictionary};
+use super::{FstDictionary, FuzzyMatchResult, WordId, dictionary::Dictionary};
use crate::{CharString, DictWordMetadata};
/// A simple wrapper over [`Dictionary`] that allows
diff --git a/harper-dictionary-wordlist/src/lib.rs b/harper-dictionary-wordlist/src/lib.rs
index e5ae7bdbb..ff3466b54 100644
--- a/harper-dictionary-wordlist/src/lib.rs
+++ b/harper-dictionary-wordlist/src/lib.rs
@@ -1,9 +1,10 @@
-use harper_core::DialectFlags;
-use itertools::Itertools;
use std::path::Path;
-use harper_core::spell::{Dictionary, MutableDictionary};
-use harper_core::{Dialect, DictWordMetadata};
+use harper_core::{
+ Dialect, DialectFlags, DictWordMetadata,
+ spell::{Dictionary, MutableDictionary},
+};
+use itertools::Itertools;
use tokio::fs::{self, File};
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, BufReader, BufWriter, Result};