How to Use Semantic Versioning for Rust Crates

Set the version in Cargo.toml to MAJOR.MINOR.PATCH and increment the specific number based on whether your changes are breaking, new features, or bug fixes.

Use Semantic Versioning (SemVer) by setting the version field in your Cargo.toml to MAJOR.MINOR.PATCH, where you increment MAJOR for breaking changes, MINOR for backward-compatible features, and PATCH for backward-compatible bug fixes.

[package]
name = "my_crate"
version = "1.2.3"
edition = "2024"

When you make a change, update the number accordingly: bump to 1.2.4 for a bug fix, 1.3.0 for a new feature, or 2.0.0 if you break existing APIs.