semver-bump-trait

Crates.iosemver-bump-trait
lib.rssemver-bump-trait
version0.1.0
sourcesrc
created_at2024-01-24 19:42:18.675654
updated_at2024-01-24 19:42:18.675654
descriptionProvides the SemverBump trait for semver::Version.
homepagehttps://adam-gaia.github.io/semver-bump
repositoryhttps://github.com/adam-gaia/semver-bump
max_upload_size
id1112796
size28,205
Adam Gaia (adam-gaia)

documentation

README

semver-bump-trait

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.

Usage

Include SemverBump in your Cargo.toml dependencies:

[dependencies]
semver = "1.0.21"
semver-bump = "0.1.0"

Mutable API

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);

Immutable API

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);

API Docs

For a complete list of methods and detailed usage, refer to the API documentation.

Commit count: 0

cargo fmt