Recursively walks the directory tree starting at `path` and calls the call back function for every file encountered.
(path: &str, callback: &mut F)
| 238 | /// Recursively walks the directory tree starting at `path` and |
| 239 | /// calls the call back function for every file encountered. |
| 240 | pub fn list_files<F>(path: &str, callback: &mut F) |
| 241 | where |
| 242 | F: FnMut(&str), |
| 243 | { |
| 244 | let mut entries: Vec<fs::DirEntry> = |
| 245 | fs::read_dir(path).unwrap().filter_map(Result::ok).collect(); |
| 246 | entries.sort_by_key(|entry| entry.path()); |
| 247 | |
| 248 | for dir_entry in entries { |
| 249 | let path = dir_entry.path(); |
| 250 | if path.is_dir() { |
| 251 | // Recurse into the sub‑directory |
| 252 | list_files(&path.to_string_lossy(), callback); |
| 253 | } else { |
| 254 | // For files, invoke the callback with the full path as a string |
| 255 | let full_str = path.to_string_lossy(); |
| 256 | callback(&full_str); |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | /// Loads all benchmark files in the `sql_benchmarks` directory. |
| 262 | /// For each file ending with `.benchmark` it creates a new |
no test coverage detected
searching dependent graphs…