Crates.io | semver-bump-trait |
lib.rs | semver-bump-trait |
version | 0.1.0 |
source | src |
created_at | 2024-01-24 19:42:18.675654 |
updated_at | 2024-01-24 19:42:18.675654 |
description | Provides the SemverBump trait for semver::Version. |
homepage | https://adam-gaia.github.io/semver-bump |
repository | https://github.com/adam-gaia/semver-bump |
max_upload_size | |
id | 1112796 |
size | 28,205 |
This crate defines a SemverBump
trait and implements it for the Version
struct from the ubiquitous semver crate.
The trait provides methods for incrementing or setting specific parts of a semantic version number.
Include SemverBump
in your Cargo.toml
dependencies:
[dependencies]
semver = "1.0.21"
semver-bump = "0.1.0"
use semver::Version;
use semver_bump_trait::SemverBump;
let mut version = Version::parse("1.1.3").unwrap();
version.mut_increment_minor();
assert_eq!(Version::parse("1.2.0").unwrap(), version);
use semver::Version;
use semver_bump_trait::SemverBump;
let version = Version::parse("1.1.3").unwrap();
let updated = version.increment_minor();
assert_eq!(Version::parse("1.2.0").unwrap(), updated);
For a complete list of methods and detailed usage, refer to the API documentation.