pub fn _search_subfolders(path: &Path) -> Vec { let dirs = std::fs::read_dir(path).unwrap(); let mut folders: Vec = vec![]; for dir in dirs { let dirpath = dir.unwrap().path(); let path = Path::new(dirpath.as_path()); if path.is_dir() { folders.push(dirpath.to_str().unwrap().to_string()); for f in _search_subfolders(path) { folders.push(f); } } } folders } pub fn _dedup(list: &mut Vec) -> usize { // Begin with sorting entries list.sort(); // Then deduplicate list.dedup(); // Return the length list.len() } pub async fn _sleep_ms(ms: u64) { sleep(Duration::from_millis(ms)).await; }