pub fn find_package(manifest_path: Option<&Path>) -> Result<Package>Expand description
Find the Cargo package using cargo_metadata.
This automatically respects Cargo’s --manifest-path option when running
as a cargo subcommand.
Returns the package that corresponds to the current context, in order:
- Package whose directory matches the current working directory
- Package whose manifest path matches
current_dir/Cargo.toml - Root package (if workspace has a root package)
- First default-member (if workspace has default-members configured)
- Error if no package can be determined