mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-21 08:30:57 -05:00
chore(CI): Fighting clippy
This commit is contained in:
parent
feaad8d94d
commit
905de9bd8d
4 changed files with 7 additions and 5 deletions
3
build.rs
3
build.rs
|
@ -13,7 +13,7 @@ fn main() {
|
|||
write!(&mut file, "use unicase::UniCase;").unwrap();
|
||||
write!(
|
||||
&mut file,
|
||||
"static DICTIONARY: phf::Map<unicase::UniCase<&'static str>, &'static str> = "
|
||||
"pub(crate) static DICTIONARY: phf::Map<unicase::UniCase<&'static str>, &'static str> = "
|
||||
)
|
||||
.unwrap();
|
||||
let mut builder = phf_codegen::Map::new();
|
||||
|
@ -24,7 +24,6 @@ fn main() {
|
|||
for record in &records {
|
||||
let value = format!(r#""{}""#, &record[1]);
|
||||
builder.entry(unicase::UniCase(&record[0]), &value);
|
||||
break;
|
||||
}
|
||||
builder.build(&mut file).unwrap();
|
||||
write!(&mut file, ";\n").unwrap();
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#[allow(clippy)]
|
||||
include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
|
||||
use unicase::UniCase;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Dictionary {}
|
||||
|
@ -10,7 +9,7 @@ impl Dictionary {
|
|||
}
|
||||
|
||||
pub fn correct_str<'s, 'w>(&'s self, word: &'w str) -> Option<&'s str> {
|
||||
map_lookup(&DICTIONARY, word)
|
||||
map_lookup(&crate::dict_codegen::DICTIONARY, word)
|
||||
}
|
||||
|
||||
pub fn correct_bytes<'s, 'w>(&'s self, word: &'w [u8]) -> Option<&'s str> {
|
||||
|
|
3
src/dict_codegen.rs
Normal file
3
src/dict_codegen.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
#![allow(clippy::all)]
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
|
|
@ -2,6 +2,7 @@
|
|||
extern crate serde_derive;
|
||||
|
||||
mod dict;
|
||||
mod dict_codegen;
|
||||
|
||||
pub mod report;
|
||||
pub mod tokens;
|
||||
|
|
Loading…
Reference in a new issue