From 975dab851405fa71524f62f09e587a82af66b068 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 30 Oct 2019 07:19:27 -0600 Subject: [PATCH] chore(benches): Fix compilation errors --- benches/corrections.rs | 6 +++--- benches/data.rs | 2 +- benches/file.rs | 12 ++++++------ src/lib.rs | 1 + 4 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 src/lib.rs diff --git a/benches/corrections.rs b/benches/corrections.rs index 40a4520..4cb0fde 100644 --- a/benches/corrections.rs +++ b/benches/corrections.rs @@ -4,12 +4,12 @@ extern crate test; #[bench] fn load_corrections(b: &mut test::Bencher) { - b.iter(|| typos_dict::BuiltIn::new()); + b.iter(|| typos_cli::dict::BuiltIn::new()); } #[bench] fn correct_word_hit(b: &mut test::Bencher) { - let corrections = typos_dict::BuiltIn::new(); + let corrections = typos_cli::dict::BuiltIn::new(); let input = typos::tokens::Word::new("successs", 0).unwrap(); assert_eq!( corrections.correct_word(input), @@ -20,7 +20,7 @@ fn correct_word_hit(b: &mut test::Bencher) { #[bench] fn correct_word_miss(b: &mut test::Bencher) { - let corrections = typos_dict::BuiltIn::new(); + let corrections = typos_cli::dict::BuiltIn::new(); let input = typos::tokens::Word::new("success", 0).unwrap(); assert_eq!(corrections.correct_word(input), None); b.iter(|| corrections.correct_word(input)); diff --git a/benches/data.rs b/benches/data.rs index 4252655..4c67ead 100644 --- a/benches/data.rs +++ b/benches/data.rs @@ -28,4 +28,4 @@ fn main() { } "; -pub const CORPUS: &str = include_str!("../typos-dict/assets/words.csv"); +pub const CORPUS: &str = include_str!("../dict/typos/assets/words.csv"); diff --git a/benches/file.rs b/benches/file.rs index fc941e2..e8d667b 100644 --- a/benches/file.rs +++ b/benches/file.rs @@ -13,7 +13,7 @@ fn check_file_empty(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::EMPTY).unwrap(); - let corrections = typos_dict::BuiltIn::new(); + let corrections = typos_cli::dict::BuiltIn::new(); let parser = typos::tokens::Parser::new(); let checks = typos::checks::CheckSettings::new().build(&corrections, &parser); b.iter(|| checks.check_file(sample_path.path(), true, typos::report::print_silent)); @@ -27,7 +27,7 @@ fn check_file_no_tokens(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::NO_TOKENS).unwrap(); - let corrections = typos_dict::BuiltIn::new(); + let corrections = typos_cli::dict::BuiltIn::new(); let parser = typos::tokens::Parser::new(); let checks = typos::checks::CheckSettings::new().build(&corrections, &parser); b.iter(|| checks.check_file(sample_path.path(), true, typos::report::print_silent)); @@ -41,7 +41,7 @@ fn check_file_single_token(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::SINGLE_TOKEN).unwrap(); - let corrections = typos_dict::BuiltIn::new(); + let corrections = typos_cli::dict::BuiltIn::new(); let parser = typos::tokens::Parser::new(); let checks = typos::checks::CheckSettings::new().build(&corrections, &parser); b.iter(|| checks.check_file(sample_path.path(), true, typos::report::print_silent)); @@ -55,7 +55,7 @@ fn check_file_sherlock(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::SHERLOCK).unwrap(); - let corrections = typos_dict::BuiltIn::new(); + let corrections = typos_cli::dict::BuiltIn::new(); let parser = typos::tokens::Parser::new(); let checks = typos::checks::CheckSettings::new().build(&corrections, &parser); b.iter(|| checks.check_file(sample_path.path(), true, typos::report::print_silent)); @@ -69,7 +69,7 @@ fn check_file_code(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::CODE).unwrap(); - let corrections = typos_dict::BuiltIn::new(); + let corrections = typos_cli::dict::BuiltIn::new(); let parser = typos::tokens::Parser::new(); let checks = typos::checks::CheckSettings::new().build(&corrections, &parser); b.iter(|| checks.check_file(sample_path.path(), true, typos::report::print_silent)); @@ -83,7 +83,7 @@ fn check_file_corpus(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::CORPUS).unwrap(); - let corrections = typos_dict::BuiltIn::new(); + let corrections = typos_cli::dict::BuiltIn::new(); let parser = typos::tokens::Parser::new(); let checks = typos::checks::CheckSettings::new().build(&corrections, &parser); b.iter(|| checks.check_file(sample_path.path(), true, typos::report::print_silent)); diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..f67cf6d --- /dev/null +++ b/src/lib.rs @@ -0,0 +1 @@ +pub mod dict;