Crates.io | dewey |
lib.rs | dewey |
version | 0.3.0 |
source | src |
created_at | 2017-08-11 20:15:01.574419 |
updated_at | 2022-11-01 13:28:24.030287 |
description | version parser and comparator that works with non-semantic versions |
homepage | |
repository | https://github.com/Gottox/dewey |
max_upload_size | |
id | 27244 |
size | 30,671 |
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
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);
1.0_1
0.0alpha1
0.0beta1
0.0pre1
0.0rc1
0.0pl1
1.0
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);