Skip to content

Commit 6c9946f

Browse files
authored
Remove lazy_static dependency (#268)
1 parent d9682df commit 6c9946f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ conv = "0.3"
4343
num-traits = "0.2"
4444
serde = "1.0"
4545
serde_json = "1.0"
46-
lazy_static = { version = "1.4", optional = true }
4746
indexmap = "2.0"
4847
rayon = { version = "1.7", optional = true }
4948
itertools = "0.14"
@@ -76,7 +75,7 @@ association = []
7675
pcsaft = ["association"]
7776
epcsaft = ["association"]
7877
gc_pcsaft = ["association"]
79-
uvtheory = ["lazy_static"]
78+
uvtheory = []
8079
pets = []
8180
saftvrqmie = []
8281
saftvrmie = []

src/uvtheory/parameters.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use feos_core::parameter::{Identifier, ParameterError};
22
use feos_core::parameter::{Parameter, PureRecord};
3-
use lazy_static::lazy_static;
43
use ndarray::concatenate;
54
use ndarray::prelude::*;
65
use ndarray::Array2;
@@ -9,6 +8,7 @@ use serde::{Deserialize, Serialize};
98
use std::collections::HashMap;
109
use std::fmt;
1110
use std::fmt::Write;
11+
use std::sync::LazyLock;
1212

1313
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1414
pub struct NoRecord;
@@ -74,9 +74,9 @@ impl std::fmt::Display for UVTheoryBinaryRecord {
7474
}
7575
}
7676

77-
lazy_static! {
7877
/// Constants for BH temperature dependent HS diameter.
79-
static ref CD_BH: Array2<f64> = arr2(&[
78+
static CD_BH: LazyLock<Array2<f64>> = LazyLock::new(|| {
79+
arr2(&[
8080
[0.0, 1.09360455168912E-02, 0.0],
8181
[-2.00897880971934E-01, -1.27074910870683E-02, 0.0],
8282
[
@@ -89,8 +89,8 @@ lazy_static! {
8989
5.05384813757953E-03,
9090
4.91003312452622E-02,
9191
],
92-
]);
93-
}
92+
])
93+
});
9494

9595
#[inline]
9696
pub fn mie_prefactor<D: DualNum<f64> + Copy>(rep: D, att: D) -> D {

0 commit comments

Comments
 (0)