Skip to content

Commit

Permalink
deprecate lazy_static + force latest rust on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Arruda committed Jul 30, 2024
1 parent eea3f66 commit 1288a35
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ jobs:
uses: actions/checkout@v4
with:
ref: stable
- name: Install latest rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build shared object
run: |
make cjyafn
Expand All @@ -89,6 +93,10 @@ jobs:
uses: actions/checkout@v4
with:
ref: stable
- name: Install latest rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Prepare the machine
run: |
pip install maturin
Expand All @@ -110,6 +118,10 @@ jobs:
uses: actions/checkout@v4
with:
ref: stable
- name: Install latest rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build extensions
run: |
cd jyafn-ext
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.

1 change: 0 additions & 1 deletion jyafn/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ get-size = { version = "0.1.4", features = ["derive"] }
glob = "0.3.1"
hashbrown = { version = "0.14.3", features = ["serde", "raw"] }
home = "0.5.9"
lazy_static = "1.4.0"
libloading = "0.8.4"
qbe = { path = "../vendored/qbe-rs" }
rand = "0.8.5"
Expand Down
7 changes: 2 additions & 5 deletions jyafn/src/graph/compile/qbe_app.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use lazy_static::lazy_static;
use rand::random;
use std::path::PathBuf;
use std::sync::Mutex;
use std::sync::{LazyLock, Mutex};
use std::{env, fs, io};

const BIN: &[u8] = include_bytes!("../../../../vendored/qbe/qbe");

lazy_static! {
static ref CURRENT_QBE: Mutex<Option<PathBuf>> = Mutex::default();
}
static CURRENT_QBE: LazyLock<Mutex<Option<PathBuf>>> = LazyLock::new(Mutex::default);

#[cfg(unix)]
fn load() -> Result<PathBuf, io::Error> {
Expand Down
9 changes: 3 additions & 6 deletions jyafn/src/pfunc.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//! _Pure_ functions that operate on raw jyafn data.
use chrono::prelude::*;
use lazy_static::lazy_static;
use special_fun::FloatSpecial;
use std::collections::HashMap;
use std::{collections::HashMap, sync::LazyLock};
use std::ops::Rem;
use std::sync::RwLock;

Expand Down Expand Up @@ -149,10 +148,8 @@ impl PFunc {
}
}

lazy_static! {
/// All the known [`PFunc`]s.
static ref P_FUNCS: RwLock<HashMap<&'static str, PFunc>> = RwLock::new(init());
}
/// All the known [`PFunc`]s.
static P_FUNCS: LazyLock<RwLock<HashMap<&'static str, PFunc>>> = LazyLock::new(|| RwLock::new(init()));

/// Inscribes a new pure function.
///
Expand Down

0 comments on commit 1288a35

Please sign in to comment.