mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-22 00:51:11 -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, "use unicase::UniCase;").unwrap();
|
||||||
write!(
|
write!(
|
||||||
&mut file,
|
&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();
|
.unwrap();
|
||||||
let mut builder = phf_codegen::Map::new();
|
let mut builder = phf_codegen::Map::new();
|
||||||
|
@ -24,7 +24,6 @@ fn main() {
|
||||||
for record in &records {
|
for record in &records {
|
||||||
let value = format!(r#""{}""#, &record[1]);
|
let value = format!(r#""{}""#, &record[1]);
|
||||||
builder.entry(unicase::UniCase(&record[0]), &value);
|
builder.entry(unicase::UniCase(&record[0]), &value);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
builder.build(&mut file).unwrap();
|
builder.build(&mut file).unwrap();
|
||||||
write!(&mut file, ";\n").unwrap();
|
write!(&mut file, ";\n").unwrap();
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#[allow(clippy)]
|
use unicase::UniCase;
|
||||||
include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
|
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Dictionary {}
|
pub struct Dictionary {}
|
||||||
|
@ -10,7 +9,7 @@ impl Dictionary {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn correct_str<'s, 'w>(&'s self, word: &'w str) -> Option<&'s str> {
|
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> {
|
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;
|
extern crate serde_derive;
|
||||||
|
|
||||||
mod dict;
|
mod dict;
|
||||||
|
mod dict_codegen;
|
||||||
|
|
||||||
pub mod report;
|
pub mod report;
|
||||||
pub mod tokens;
|
pub mod tokens;
|
||||||
|
|
Loading…
Reference in a new issue