This crate provides a parser for Rust versions.
The parser will only accept Versions in the form
<major>.<minor>.<patch>
and 3 special versions:
1.0.0-alpha
1.0.0-alpha.2
1.0.0-beta
There are only 2 functions to create a RustVersion
:
const RustVersion::new(u32, u32, u32)
: This is mainly used to create
constantsRustVersion::parse(&str)
: Usually you want to parse a version with this
functionIf you have a RustVersion
you can compare them, like you would expect:
assert!(RustVersion::parse("1.42.0")? < RustVersion::parse("1.43")?);
This repository adopts the Contributor Covenant Code of Conduct
Copyright 2020 Philipp Krones
Licensed under the Apache License, Version 2.0