fn find_manifest_from_cwd() -> Result<PathBuf, failure::Error> {
    let mut parent_path = std::env::current_dir()?;
    let mut manifest_path = parent_path.join("Cargo.toml");
    loop {
        if !manifest_path.is_file() {
            if parent_path.pop() {
                manifest_path = parent_path.join("Cargo.toml");
            } else {
                return Ok(PathBuf::from("."));
            }
        } else {
            return Ok(parent_path);
        }
    }
}
/// Search up the path for the manifest file from the current working directory
/// If we don't find the manifest file then return back the current working directory
/// to provide the appropriate error
Search up the path for the manifest file from the current working directory
If we don't find the manifest file then return back the current working directory
to provide the appropriate error
Search up the path for the manifest file from the current working directory If we don ' t find the manifest file then return back the current working directory to provide the appropriate error
fn find_manifest_from_cwd() -> Result<PathBuf, failure::Error> {
    let mut parent_path = std::env::current_dir()?;
    let mut manifest_path = parent_path.join("Cargo.toml");
    loop {
        if !manifest_path.is_file() {
            if parent_path.pop() {
                manifest_path = parent_path.join("Cargo.toml");
            } else {
                return Ok(PathBuf::from("."));
            }
        } else {
            return Ok(parent_path);
        }
    }
}
fn find_manifest_from_cwd ( ) -> Result < PathBuf , failure :: Error > { let mut parent_path = std :: env :: current_dir ( ) ? ; let mut manifest_path = parent_path . join ( " " ) ; loop { if ! manifest_path . is_file ( ) { if parent_path . pop ( ) { manifest_path = parent_path . join ( " " ) ; } else { return Ok ( PathBuf :: from ( " " ) ) ; } } else { return Ok ( parent_path ) ; } } }
Search up the path for the manifest file from the current working directory
If we don't find the manifest file then return back the current working directory
to provide the appropriate error
Search up the path for the manifest file from the current working directory If we don ' t find the manifest file then return back the current working directory to provide the appropriate error