(
result: &mut HashSet<PathBuf>,
dir: P,
)
| 29 | fn search_registry(result: &mut HashSet<PathBuf>) {} |
| 30 | |
| 31 | fn search_java_dir<P: AsRef<Path>>( |
| 32 | result: &mut HashSet<PathBuf>, |
| 33 | dir: P, |
| 34 | ) -> Result<(), SearchError> { |
| 35 | for dir in match fs::read_dir(dir) { |
| 36 | Err(err) if err.kind() == IOErrorKind::NotFound => return Ok(()), |
| 37 | r => r, |
| 38 | }? { |
| 39 | let dir = match dir { |
| 40 | Err(err) if err.kind() == IOErrorKind::NotFound => continue, |
| 41 | r => r, |
| 42 | }?; |
| 43 | let mut path = dir.path(); |
| 44 | if !path.is_dir() { |
| 45 | continue; |
| 46 | } |
| 47 | path.push(JAVA_EXECUTABLE); |
| 48 | if path.exists() { |
| 49 | result.insert(path); |
| 50 | } |
| 51 | } |
| 52 | Ok(()) |
| 53 | } |
| 54 | |
| 55 | fn search_java_dirs(result: &mut HashSet<PathBuf>) -> Result<(), SearchError> { |
| 56 | cfg_if! { |
nothing calls this directly
no outgoing calls
no test coverage detected