4 releases (2 stable)
|1.1.0||Nov 29, 2020|
|1.0.0||Nov 27, 2020|
|0.1.1||Nov 26, 2020|
|0.1.0||Nov 26, 2020|
#24 in Configuration
19,033 downloads per month
This crate provides a minimalistic parser for Rust versions.
The parser will only accept Versions in the form
and 3 special versions:
This covers every version of
rustc that were released to date.
There are 2 functions to create a
const RustcVersion::new(u32, u32, u32): This is mainly used to create constants
RustcVersion::parse(&str): Usually you want to parse a version with this function
If you have a
RustcVersion you can compare them, like you would expect:
assert!(RustcVersion::parse("1.42.0")? < RustcVersion::parse("1.43")?);
If you want to check whether one version meets another version according to the
Caret Requirements, there is the method
assert!(RustcVersion::new(1, 48, 0).meets(RustcVersion::parse("1.42")?));
This repository adopts the Contributor Covenant Code of Conduct
Copyright 2020 Philipp Krones
Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option. Files in the project may not be copied, modified, or distributed except according to those terms.