Skip to content

Commit

Permalink
refactor: replace once_cell with std::sync::LazyLock, bumping msr…
Browse files Browse the repository at this point in the history
…v to `1.80.1` (#261)
  • Loading branch information
mbrobbel authored Dec 4, 2024
1 parent ebd0bcf commit 816a6e2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
- uses: dtolnay/rust-toolchain@1.75.0
- uses: dtolnay/rust-toolchain@1.80.1
id: rust-toolchain
- uses: actions/cache@v4
with:
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

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

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "substrait"
version = "0.49.4"
edition = "2021"
rust-version = "1.75.0"
rust-version = "1.80.1"
description = "Cross-Language Serialization for Relational Algebra"
documentation = "https://docs.rs/substrait"
readme = "README.md"
Expand All @@ -26,15 +26,14 @@ include = [

[features]
default = []
extensions = ["dep:once_cell", "dep:serde_yaml"]
extensions = ["dep:serde_yaml"]
parse = ["dep:hex", "dep:thiserror", "dep:url", "semver"]
protoc = ["dep:protobuf-src"]
semver = ["dep:semver"]
serde = ["dep:pbjson", "dep:pbjson-build", "dep:pbjson-types"]

[dependencies]
hex = { version = "0.4.3", optional = true }
once_cell = { version = "1.20.2", optional = true }
pbjson = { version = "0.7.0", optional = true }
pbjson-types = { version = "0.7.0", optional = true }
prost = "0.13.3"
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ const {var_name}: &str = include_str!("{}/{}");
r#"
use std::collections::HashMap;
use std::str::FromStr;
use once_cell::sync::Lazy;
use std::sync::LazyLock;
use crate::text::simple_extensions::SimpleExtensions;
use url::Url;
/// Map with Substrait core extensions. Maps URIs to included extensions.
pub static EXTENSIONS: Lazy<HashMap<Url, SimpleExtensions>> = Lazy::new(|| {
pub static EXTENSIONS: LazyLock<HashMap<Url, SimpleExtensions>> = LazyLock::new(|| {
let mut map = HashMap::new();"#,
);

Expand Down
4 changes: 2 additions & 2 deletions src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ include!(concat!(env!("OUT_DIR"), "/extensions.in"));
mod tests {
use super::*;

use once_cell::sync::Lazy;
use std::sync::LazyLock;

#[test]
fn core_extensions() {
// Force evaluation of core extensions.
Lazy::force(&EXTENSIONS);
LazyLock::force(&EXTENSIONS);
}
}

0 comments on commit 816a6e2

Please sign in to comment.