Recursively read all files in this dir.
(dir: &Path)
| 711 | |
| 712 | /// Recursively read all files in this dir. |
| 713 | pub fn read_all_files_in_dir(dir: &Path) -> Result<Vec<PathBuf>> { |
| 714 | let mut files = Vec::new(); |
| 715 | for entry in std::fs::read_dir(dir).context(format!("cannot open dir: {dir:?}"))? { |
| 716 | let entry = entry?.path(); |
| 717 | if entry.is_file() { |
| 718 | files.push(entry); |
| 719 | } else if entry.is_dir() { |
| 720 | files.extend(read_all_files_in_dir(&entry)?); |
| 721 | } |
| 722 | } |
| 723 | Ok(files) |
| 724 | } |
| 725 | |
| 726 | /// get the build static library linked with sanitizers |
| 727 | pub fn get_san_lib_path(deopt: &Deopt) -> &'static PathBuf { |
no test coverage detected