MCPcopy Create free account
hub / github.com/HelixLauncher/HelixLauncher / search_java_dir

Function search_java_dir

helixlauncher-java/src/search.rs:31–53  ·  view source on GitHub ↗
(
    result: &mut HashSet<PathBuf>,
    dir: P,
)

Source from the content-addressed store, hash-verified

29fn search_registry(result: &mut HashSet<PathBuf>) {}
30
31fn 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
55fn search_java_dirs(result: &mut HashSet<PathBuf>) -> Result<(), SearchError> {
56 cfg_if! {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected