diff options
| -rw-r--r-- | src/bibiman/bibisetup.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/bibiman/bibisetup.rs b/src/bibiman/bibisetup.rs index 0914f7c..92e02fc 100644 --- a/src/bibiman/bibisetup.rs +++ b/src/bibiman/bibisetup.rs @@ -455,37 +455,6 @@ impl BibiSetup { } } -/// This function walks the given dir and collects all pdf files into a `Vec` -pub fn collect_pdf_files(pdf_dir: &PathBuf) -> Option<Vec<PathBuf>> { - let mut files: Vec<PathBuf> = Vec::new(); - - // Expand tilde to /home/user - let pdf_dir = if pdf_dir.starts_with("~") { - &app::expand_home(&pdf_dir) - } else { - pdf_dir - }; - - // Walk the passed dir and collect all pdf files into vec - if pdf_dir.is_dir() { - for file in WalkDir::new(pdf_dir) { - let f = file.unwrap().into_path(); - if f.is_file() - && f.extension().is_some() - && f.extension().unwrap_or_default().to_ascii_lowercase() == "pdf" - { - files.push(f); - } - } - } - - if files.is_empty() { - None - } else { - Some(files) - } -} - /// This function walks the given dir and collects all pdf files into a `HashMap` /// of the format `[String, Vec<PathBuf>]`, where `String` represents the basename /// of the file and the `Vec<PathBuf>` holds all filepaths ending with this basename. |
