semver
Parser and evaluator for Cargo's flavor of Semantic Versioning
This package has a good security score with no known vulnerabilities.
Community Reviews
Zero-overhead version parsing that just works in production
The library handles Cargo's semver flavor perfectly, including pre-release tags and build metadata. Comparison operators work as expected via Ord/PartialOrd, and the `VersionReq` type for range matching (like "^1.2.3") has saved me from writing brittle version logic countless times. Zero configuration needed, no connection pools or resources to manage, and the error types are simple enough that you don't need special observability.
In five years of using this across microservices and CLI tools, I've never had a version-related bug traced back to semver's behavior. It's stable across versions with no breaking changes in recent memory. The crate compiles in milliseconds and adds negligible size to binaries.
Best for: Any Rust project needing to parse, compare, or validate semantic versions with Cargo compatibility.
Avoid if: You need complex version manipulation beyond parsing and comparison, or require non-Cargo semver dialects.
Rock-solid semver parsing with excellent ergonomics and type safety
Day-to-day usage is friction-free. IDE autocomplete works perfectly thanks to well-structured types. Error handling is straightforward with descriptive `Error` types that tell you exactly what went wrong in a version string. The documentation includes practical examples for every common operation, and the API surface is small enough to learn quickly but complete enough for any semver need.
This crate is maintained by the Cargo team, which means it stays in sync with Cargo's actual semver implementation. You're not guessing about edge cases - this is the canonical implementation. It's also extremely stable with a 1.0+ version that rarely breaks compatibility.
Best for: Any Rust project needing to parse, validate, compare, or match semantic version numbers, especially tools interacting with Cargo.
Avoid if: You need strict semver 2.0 compliance for non-Rust ecosystems or require advanced version manipulation utilities.
Rock-solid semver parsing with excellent ergonomics and type safety
Comparison operations are intuitive and work exactly as you'd expect. The `matches()` method for checking version requirements is clean and readable. I particularly appreciate how it handles Cargo-specific semver quirks (pre-release ordering, caret/tilde requirements) correctly out of the box. The type system prevents common mistakes - you can't accidentally compare incompatible types or forget to handle parsing errors.
Documentation is comprehensive with clear examples for every major use case. The crate is feature-complete without bloat, compiles fast, and has zero dependencies by default. It's maintained by the Cargo team, so it stays perfectly aligned with Cargo's semver interpretation.
Best for: Any Rust project needing to parse, compare, or validate semantic versions, especially when working with Cargo ecosystems.
Avoid if: You need strict semver 2.0.0 compliance without Cargo's extensions (though differences are minor).
Sign in to write a review
Sign In