(
d: &Dir,
p: impl AsRef<Path>,
)
| 45 | } |
| 46 | |
| 47 | fn read_dir_optional( |
| 48 | d: &Dir, |
| 49 | p: impl AsRef<Path>, |
| 50 | ) -> std::io::Result<Option<cap_std::fs::ReadDir>> { |
| 51 | match d.read_dir(p.as_ref()) { |
| 52 | Ok(r) => Ok(Some(r)), |
| 53 | Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(None), |
| 54 | Err(e) => Err(e), |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | /// Find the kernel modules directory in checked out directory tree. |
| 59 | /// The target directory will have a `vmlinuz` file representing the kernel binary. |
no test coverage detected