pub fn find_bazel_workspace_root(manifest_path: &Path) -> Option<PathBuf> {
  let mut dir = if manifest_path.is_dir() {
    Some(manifest_path)
  } else {
    manifest_path.parent()
  };

  while let Some(current_dir) = dir {
    if is_bazel_workspace_root(current_dir) {
      return Some(PathBuf::from(current_dir));
    }

    dir = current_dir.parent();
  }

  None
}
/// Returns a path to a Bazel workspace root based on the current working
/// directory, otherwise None if not workspace is detected.
Returns a path to a Bazel workspace root based on the current working
directory, otherwise None if not workspace is detected.
Returns a path to a Bazel workspace root based on the current working directory otherwise None if not workspace is detected .
pub fn find_bazel_workspace_root(manifest_path: &Path) -> Option<PathBuf> {
  let mut dir = if manifest_path.is_dir() {
    Some(manifest_path)
  } else {
    manifest_path.parent()
  };
  while let Some(current_dir) = dir {
    if is_bazel_workspace_root(current_dir) {
      return Some(PathBuf::from(current_dir));
    }
    dir = current_dir.parent();
  }
  None
}
pub fn find_bazel_workspace_root ( manifest_path : & Path ) -> Option < PathBuf > { let mut dir = if manifest_path . is_dir ( ) { Some ( manifest_path ) } else { manifest_path . parent ( ) } ; while let Some ( current_dir ) = dir { if is_bazel_workspace_root ( current_dir ) { return Some ( PathBuf :: from ( current_dir ) ) ; } dir = current_dir . parent ( ) ; } None }
Returns a path to a Bazel workspace root based on the current working
directory, otherwise None if not workspace is detected.
Returns a path to a Bazel workspace root based on the current working directory otherwise None if not workspace is detected .
manifest_path
&Path
manifest_path
&Path