diff options
author | Jon Moroney <darakian@gmail.com> | 2020-07-13 09:15:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-13 09:15:28 -0700 |
commit | 4e7c67c9260e6bd43f8d8ce4619a983017ca3366 (patch) | |
tree | ea3da46cd85761865f785166cf20a428b5ce2aa2 | |
parent | ec63f1d9a7c250dee97ff8b0bbdfd240260bc32e (diff) | |
parent | c68d7640d5badfbf734609a27eef7715abec9f3e (diff) |
Merge pull request #32 from darakian/use-candidate-name-for-results
Use get_candidate_name() for results output
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 4be89ea..adb56b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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(); |