semver-parser 0.10.3

Parsing of the semver spec.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use semver_parser::Compat;
use semver_parser::RangeSet;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    // default operation
    let range_set: RangeSet = "1.2.3".parse()?;
    println!("Found range set: {:?}", range_set);

    // npm compatibility
    let range_set = RangeSet::parse("1.2.3", Compat::Npm)?;
    println!("Found range set (node): {:?}", range_set);

    Ok(())
}