Skip to content

Commit

Permalink
Merge pull request #33 from messense/once-cell
Browse files Browse the repository at this point in the history
Use once_cell to lower MSRV
  • Loading branch information
konstin authored Dec 4, 2024
2 parents 6afdd61 + baa330c commit 274f1a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ name = "pep440_rs"
crate-type = ["rlib", "cdylib"]

[dependencies]
once_cell = { version = "1.20.2" }
serde = { version = "1.0.210", features = ["derive"] }
rkyv = { version = "0.8.9", optional = true }
tracing = { version = "0.1.40", optional = true }
Expand Down
5 changes: 2 additions & 3 deletions src/version.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use once_cell::sync::Lazy;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use std::sync::LazyLock;
use std::{
borrow::Borrow,
cmp::Ordering,
Expand Down Expand Up @@ -2395,8 +2395,7 @@ fn parse_u64(bytes: &[u8]) -> Result<u64, VersionParseError> {
}

/// The minimum version that can be represented by a [`Version`]: `0a0.dev0`.
pub static MIN_VERSION: LazyLock<Version> =
LazyLock::new(|| Version::from_str("0a0.dev0").unwrap());
pub static MIN_VERSION: Lazy<Version> = Lazy::new(|| Version::from_str("0a0.dev0").unwrap());

#[cfg(test)]
mod tests;

0 comments on commit 274f1a3

Please sign in to comment.