Crates.io | compare_version |
lib.rs | compare_version |
version | 0.1.1 |
source | src |
created_at | 2024-11-01 14:06:37.111996 |
updated_at | 2024-11-01 14:08:32.539998 |
description | A Rust library for comparing semantic versioning strings and checking version compatibility. |
homepage | |
repository | https://github.com/ltpp-universe/compare_version |
max_upload_size | |
id | 1431822 |
size | 15,699 |
A Rust library for comparing semantic versioning strings and checking version compatibility.
^
and ~
notation.To use this crate, you can run cmd:
cargo add compare_version
use compare_version::*;
let result = compare_versions("1.2.3", "1.2.4");
assert_eq!(result, Ok(VersionComparison::Less));
let matches = matches_version_range("1.2.3", "^1.2.0");
assert_eq!(matches, Ok(true));
let matches = matches_version_range("1.2.3", "~1.2.4");
assert_eq!(matches, Ok(false));
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request.
For any inquiries, please reach out to the author at ltpp-universe root@ltpp.vip.