Skip to content

Commit

Permalink
Remove debug_unreachable dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mitiko committed Mar 9, 2024
1 parent d492fea commit 96c7e87
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 37 deletions.
25 changes: 0 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ categories = ["compression"]
default-run = "weath3rb0i"

[dependencies]
debug_unreachable = "0.1"
rayon = "1.9.0"
rayon = "1.9.0" # MT only used for search, compression is single threaded

[profile.dev]
opt-level = 1
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ pub mod models;
mod hashmap;
mod mixers;
mod state_table;

pub use debug_unreachable::debug_unreachable;
10 changes: 2 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::time::Instant;
use std::{env, fs, fs::File, path::PathBuf};

use weath3rb0i::{
debug_unreachable,
entropy_coding::{
arithmetic_coder::ArithmeticCoder,
io::{ACReader, ACWriter},
Expand Down Expand Up @@ -32,12 +31,7 @@ fn main() -> std::io::Result<()> {
"c" => Action::Compress,
"d" => Action::Decompress,
"t" => Action::Test,
_ => {
print_usage_and_exit("Unrecognized option -> <action>!");
unsafe {
debug_unreachable!();
} // we've already panicked
}
_ => print_usage_and_exit("Unrecognized option -> <action>!"),
};

if !path.is_file() && !path.is_dir() {
Expand Down Expand Up @@ -157,7 +151,7 @@ fn init_model() -> impl Model {
OrderNEntropy::new(11, 3, ACHistory::new(8, StationaryModel::for_book1()))
}

fn print_usage_and_exit(msg: &str) {
fn print_usage_and_exit(msg: &str) -> ! {
println!("Usage: weath3rb0i <Action> <Path>");
println!("<Action> [single file]: c (compress), d (decompress), t (test = c + d)");
println!("<Path> can be a single file or a directory");
Expand Down

0 comments on commit 96c7e87

Please sign in to comment.