We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a676f22 commit 8c8b266Copy full SHA for 8c8b266
Cargo.toml
@@ -1,6 +1,6 @@
1
[package]
2
name = "version"
3
-version = "0.1.1"
+version = "0.1.2"
4
edition = "2021"
5
authors = ["Marcos Gutiérrez Alonso <marcos56@mailbox.org>"]
6
description = "A library to handle version numbers"
src/lib.rs
@@ -17,8 +17,8 @@ pub struct Version {
17
18
impl Version {
19
pub fn get() -> Option<Self> {
20
- match option_env!("CARGO_PKG_VERSION") {
21
- Some(v) => {
+ match std::env::var("CARGO_PKG_VERSION") {
+ Ok(v) => {
22
let s: Vec<&str> = v.split(".").collect();
23
24
if s.len() < 3 {
@@ -31,7 +31,7 @@ impl Version {
31
patch: u32::from_str_radix(s[2], 9).unwrap_or(0),
32
})
33
}
34
- None => None,
+ _ => None,
35
36
37
0 commit comments