#semver #compare

compare_version

A Rust library for comparing semantic versioning strings and checking version compatibility

33 releases (17 stable)

Uses new Rust 2024

2.0.4 Feb 1, 2026
1.2.9 Jan 10, 2026
1.2.7 Dec 13, 2025
1.2.5 Oct 19, 2025
0.2.1 Nov 30, 2024

#615 in Algorithms

Download history 71/week @ 2025-10-22 16/week @ 2025-10-29 3/week @ 2025-11-26 3/week @ 2025-12-03 4/week @ 2025-12-10 21/week @ 2025-12-24 8/week @ 2025-12-31 115/week @ 2026-01-07 6/week @ 2026-01-14 158/week @ 2026-01-21 126/week @ 2026-01-28 225/week @ 2026-02-04

518 downloads per month
Used in 9 crates (via hyperlane-utils)

MIT license

15KB
184 lines

compare_version

Official Documentation

Api Docs

A Rust library for comparing semantic versioning strings and checking version compatibility.

Features

  • Version Comparison: Compare two semantic versioning strings to determine their order (greater, less, equal).
  • Version Range Matching: Check if a specific version matches a specified range using ^ and ~ notation.
  • Pre-release Support: Handle pre-release versions with proper comparison logic.
  • Error Handling: Comprehensive error types to handle version parsing and range issues gracefully.

Installation

To use this crate, you can run cmd:

cargo add compare_version

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Contact

For any inquiries, please reach out to the author at root@ltpp.vip.

No runtime deps