Skip to main content

try_find_project_root

Function try_find_project_root 

Source
pub fn try_find_project_root(
    start_dir: &Path,
) -> Result<Option<ProjectRoot>, String>
Expand description

Walk up from start_dir looking for a shape.toml file.

Like find_project_root, but returns a structured Result so the caller can decide how to report errors.

Returns:

  • Ok(Some(root)) — found and parsed successfully.
  • Ok(None) — no shape.toml file anywhere up the directory tree.
  • Err(msg) — a shape.toml was found but could not be read or parsed.