dewey

Crates.iodewey
lib.rsdewey
version0.3.0
sourcesrc
created_at2017-08-11 20:15:01.574419
updated_at2022-11-01 13:28:24.030287
descriptionversion parser and comparator that works with non-semantic versions
homepage
repositoryhttps://github.com/Gottox/dewey
max_upload_size
id27244
size30,671
Enno T. Boland (Gottox)

documentation

https://docs.rs/dewey

README

dewey

dewey is a simple version parser and comperator that aims to be compatible to NetBSD and xbps' comperator implementation.

dewey not only parses .-seperated versions but other common patterns such as X.XalphaX, X.XrcX, and X.X.Xpl1

example

use dewey::VersionCmp;

let stable = "1.0".version();
let pre = "1.0pre1".version();
let pl = "1.0pl1".version();
assert!(stable > pre);
assert!(pl > stable);
assert!(pl > pre);

supported seperators

  • Revision: example: 1.0_1
  • Alpha: 0.0alpha1
  • Beta: 0.0beta1
  • Pre: 0.0pre1
  • Rc: 0.0rc1
  • PatchLevel: 0.0pl1
  • Dot: 1.0

version coverage

dewey tries its very best to produce a relationship between two version.

It even can work with rather obscure utf8 versioning:

use dewey::VersionCmp;

let smile = "1.😃".version();
let sad = "1.😢".version();
assert!(smile < sad);

It only fails if there are there are conflicting version schemes:

use dewey::VersionCmp;

let alpha_suffix = "1c".version();
let number_suffix = "1.0".version();
assert!(alpha_suffix.partial_cmp(&number_suffix) == None);
Commit count: 15

cargo fmt