flexver-rs 0.1.2

Comparer for FlexVer-spec versions
Documentation
  • Coverage
  • 0%
    0 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 8.72 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.48 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • unascribed/FlexVer
    72 10 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Infinidoge

flexver-rs

A Rust implementation of FlexVer.

Getting It

You can either copy (and rename) lib.rs wholesale into your project, or retrieve it from crates.io like so in Cargo.toml:

[dependencies]
flexver-rs = "0.1.2"

Usage

The crate provides both a compare function and the FlexVer struct. The FlexVer struct implements Ord, and thus supports all of the comparison operations.

fn compare(left: &str, right: &str) -> std::cmp::Ordering; // Type signature

assert_eq!(compare("1.0.0", "1.1.0"), Ordering::Less);

struct FlexVer(&str); // Type signature

assert!(FlexVer("1.0.0") < FlexVer("1.1.0"));

You can find additional examples in the tests section at the bottom of lib.rs.