/// Walks the current execution path and its parent directories to find the path
/// that contains .jiri_root directory.
Walks the current execution path and its parent directories to find the path
that contains .jiri_root directory.
Walks the current execution path and its parent directories to find the path that contains . jiri_root directory .
fn find_fuchsia_root(&mut self) -> Result<PathBuf> {
        if self.root_dir.is_none() {
            for ancester in std::env::current_exe()?.ancestors() {
                if let Ok(entries) = read_dir(ancester) {
                    for entry in entries {
                        if let Ok(entry) = entry {
                            if entry.path().ends_with(".jiri_root") {
                                self.root_dir.replace(ancester.to_path_buf());
                                println!(
                                    "[fvdl] Found Fuchsia root directory {:?}",
                                    self.root_dir.as_ref().unwrap().display()
                                );
                                return Ok(ancester.to_path_buf());
                            }
                        }
                    }
                }
            }
        }
        self.root_dir
            .as_ref()
            .map(|c| c.clone())
            .ok_or(anyhow!("Cannot locate Fuchsia binaries.\n\
            SDK users, make sure you include the --sdk flag and run the program from inside the Fuchsia SDK directory.\n\
            Non-SDK users, make sure you're running the program from inside the Fuchsia source directory tree."))
    }
fn find_fuchsia_root ( & mut self ) -> Result < PathBuf > { if self . root_dir . is_none ( ) { for ancester in std :: env :: current_exe ( ) ? . ancestors ( ) { if let Ok ( entries ) = read_dir ( ancester ) { for entry in entries { if let Ok ( entry ) = entry { if entry . path ( ) . ends_with ( " " ) { self . root_dir . replace ( ancester . to_path_buf ( ) ) ; println ! ( " " self root_dir as_ref ( ) unwrap ( ) display ( ) ) ; return Ok ( ancester . to_path_buf ( ) ) ; } } } } } } self . root_dir . as_ref ( ) . map ( | c | c . clone ( ) ) . ok_or ( anyhow ! ( " \n \
 \n \
 " ) ) }
Walks the current execution path and its parent directories to find the path
that contains .jiri_root directory.
Walks the current execution path and its parent directories to find the path that contains . jiri_root directory .
&mut self