Skip to content

Commit

Permalink
Use once_cell to lower MSRV
Browse files Browse the repository at this point in the history
std `LazyLock` requires Rust 1.80 which is bit too new for using this in maturin.
  • Loading branch information
messense committed Dec 1, 2024
1 parent b0fe902 commit baa330c
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.8", 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 baa330c

Please sign in to comment.