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.
Semantic Versioning is a standard way to number software releases so users know if an update is safe. You increase the first number only if you break things, the middle number for new features, and the last number for small fixes. It acts like a traffic light system for updates: green for safe, yellow for new stuff, and red for breaking changes.