Skip to content

Commit

Permalink
Move OnceCell to lib.
Browse files Browse the repository at this point in the history
  • Loading branch information
schungx committed Oct 25, 2023
1 parent 1923344 commit 5aefae6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/config/hashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
//! ```
use super::hashing_env;

#[cfg(feature = "std")]
pub use once_cell::sync::OnceCell;

#[cfg(not(feature = "std"))]
pub use once_cell::race::OnceBox as OnceCell;
use crate::OnceCell;

static HASHING_SEED: OnceCell<Option<[u64; 4]>> = OnceCell::new();

Expand Down
4 changes: 2 additions & 2 deletions src/eval/chaining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

use super::{Caches, GlobalRuntimeState, Target};
use crate::ast::{ASTFlags, BinaryExpr, Expr, OpAssignment};
use crate::config::hashing::OnceCell;
use crate::engine::{FN_IDX_GET, FN_IDX_SET};
use crate::eval::search_namespace;
use crate::types::dynamic::Union;
use crate::{
calc_fn_hash, Dynamic, Engine, FnArgsVec, Position, RhaiResult, RhaiResultOf, Scope, ERR,
calc_fn_hash, Dynamic, Engine, FnArgsVec, OnceCell, Position, RhaiResult, RhaiResultOf, Scope,
ERR,
};
use std::hash::Hash;
#[cfg(feature = "no_std")]
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ type ExclusiveRange = std::ops::Range<INT>;
/// An inclusive integer range.
type InclusiveRange = std::ops::RangeInclusive<INT>;

#[cfg(feature = "std")]
use once_cell::sync::OnceCell;

#[cfg(not(feature = "std"))]
use once_cell::race::OnceBox as OnceCell;

#[allow(deprecated)]
pub use api::build_type::{CustomType, TypeBuilder};
#[cfg(not(feature = "no_custom_syntax"))]
Expand Down

0 comments on commit 5aefae6

Please sign in to comment.