version-rs 0.2.0

A struct for Versions, with the methods you expect
Documentation
  • Coverage
  • 61.54%
    8 out of 13 items documented0 out of 6 items with examples
  • Size
  • Source code size: 10.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.96 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • iwahbe/version-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • iwahbe

version-rs

Lots of code which handles other pieces of software involves version numbers. This involves creating approximately the same object with approximately the same 100 lines of code in multiple crates. This crate aims to avoid this boilerplate.

Obligatory Example:

use version::Version;
let v1_2_3 = Version::new(1,2,3);
assert!(v1_2_3 == "1.2.3".parse()?);
assert!(v1_2_3 < Version::new(1,2,12));
assert!(v1_2_3 > Version::from((1,2,0));
let (x, y, z) = random_usize_triple();
assert!(Version::from(x,y,z), (x,y,z).into());

Some quick copy and past ensured that Version works for u8, u16, and u32. To use, add

[dependencies]
version-rs = "0.1"

to your Cargo.toml. If you want to use Version with serde, add version-rs = {version = "0.1", features = ["serde"]} to derive Serialize and Deserialize.