Merge pull request #32 from darakian/use-candidate-name-for-results

Use get_candidate_name() for results output
This commit is contained in:
Jon Moroney 2020-07-13 09:15:28 -07:00 committed by GitHub
commit 4e7c67c926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -175,7 +175,7 @@ fn write_results_to_file(fmt: PrintFmt, shared_files: &Vec<&Fileinfo>, unique_fi
PrintFmt::Standard => {
output.write_fmt(format_args!("Duplicates:\n")).unwrap();
for file in shared_files.into_iter(){
let title = file.get_paths().get(0).unwrap().file_name().unwrap().to_str().unwrap();
let title = file.get_candidate_name();
output.write_fmt(format_args!("{}\n", title)).unwrap();
for entry in file.get_paths().iter(){
output.write_fmt(format_args!("\t{}\n", entry.as_path().to_str().unwrap())).unwrap();
@ -183,7 +183,7 @@ fn write_results_to_file(fmt: PrintFmt, shared_files: &Vec<&Fileinfo>, unique_fi
}
output.write_fmt(format_args!("Singletons:\n")).unwrap();
for file in unique_files.into_iter(){
let title = file.get_paths().get(0).unwrap().file_name().unwrap().to_str().unwrap();
let title = file.get_candidate_name();
output.write_fmt(format_args!("{}\n", title)).unwrap();
for entry in file.get_paths().iter(){
output.write_fmt(format_args!("\t{}\n", entry.as_path().to_str().unwrap())).unwrap();