chore(CI): Fighting clippy

This commit is contained in:
Ed Page 2019-06-14 14:53:34 -06:00
parent feaad8d94d
commit 905de9bd8d
4 changed files with 7 additions and 5 deletions

View file

@ -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();

View file

@ -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
View file

@ -0,0 +1,3 @@
#![allow(clippy::all)]
include!(concat!(env!("OUT_DIR"), "/codegen.rs"));

View file

@ -2,6 +2,7 @@
extern crate serde_derive;
mod dict;
mod dict_codegen;
pub mod report;
pub mod tokens;