Skip to content

Commit

Permalink
Merge pull request #102 from mastfissh/smplify
Browse files Browse the repository at this point in the history
Simplify logic
  • Loading branch information
mastfissh authored Sep 6, 2023
2 parents e915dd0 + 970c20d commit de80581
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 278 deletions.
83 changes: 9 additions & 74 deletions Cargo.lock

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

8 changes: 2 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dedupe"
version = "2.2.1"
version = "3.2.1"
authors = ["Justin Lambert <[email protected]>"]
publish = false
edition = "2021"
Expand All @@ -12,17 +12,13 @@ lto = "thin"
[dependencies]
walkdir = "2"
rayon = "1"
crossbeam-channel = "0"
typed-arena = "2"
seahash = "4"
dashmap = "5"
clap = { version = "4.4.2", features = ["derive"] }

bytesize = "1.3.0"
[lib]
name = "dupelib"
path = "src/lib.rs"


[dev-dependencies]
criterion = "0"

Expand Down
1 change: 0 additions & 1 deletion Cross.toml

This file was deleted.

22 changes: 1 addition & 21 deletions src/bin/cli.rs
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
extern crate clap;
extern crate crossbeam_channel;
extern crate dupelib;

use clap::Parser;
use crossbeam_channel::unbounded;
use crossbeam_channel::Receiver;
use crossbeam_channel::RecvError;
use crossbeam_channel::Sender;

use dupelib::detect_dupes;
use dupelib::Opt;

use std::thread;

fn run_dupe_detect(options: Opt) {
let (sender, receiver): (Sender<&str>, Receiver<&str>) = unbounded();
thread::spawn(move || {
let mut cont = true;
while cont {
cont = false;
let data = receiver.recv();
if data != Err(RecvError) {
cont = true;
println!("{}", data.unwrap());
}
}
});
let dupes = detect_dupes(options, Some(sender));
println!("{:?}", dupes);
detect_dupes(options);
}

fn main() {
Expand Down
Loading

0 comments on commit de80581

Please sign in to comment.