Skip to main content

execute_bump

Function execute_bump 

Source
pub async fn execute_bump(
    manifest_path: &str,
    bump_type: &BumpVersionType,
) -> Result<String, Box<dyn Error>>
Expand description

Read and update version in Cargo.toml

Three repository architectures are supported:

  • Shared-version monorepo ([workspace.package].version present): the workspace root version is bumped; run sync to propagate it.
  • Virtual workspace (no root [package], members carry independent versions): every member’s own version is bumped and local path dependency versions are realigned in one pass.
  • Non-monorepo single crate (plain [package].version): the crate version is bumped.

The edit is applied on a toml_edit::DocumentMut, so comments, key order and inline-table formatting outside the version value are preserved byte-for-byte.

§Arguments

  • &str: Path to Cargo.toml file
  • &BumpVersionType: Type of version bump to apply

§Returns

  • Result<String, Box<dyn std::error::Error>>: The new version string, a workspace bump summary, or an error