Fix builds.

This commit is contained in:
Stephen Chung 2021-11-28 23:06:33 +08:00
parent 9fa4d60336
commit a3e79c0bd0
6 changed files with 29 additions and 29 deletions

View File

@ -322,7 +322,7 @@ impl Engine {
/// The JSON string must be an object hash. It cannot be a simple scalar value.
///
/// Set `has_null` to `true` in order to map `null` values to `()`.
/// Setting it to `false` will cause an [`ErrorVariableNotFound`][EvalAltResult::ErrorVariableNotFound] error during parsing.
/// Setting it to `false` will cause an [`ErrorVariableNotFound`][crate::EvalAltResult::ErrorVariableNotFound] error during parsing.
///
/// # JSON With Sub-Objects
///

View File

@ -256,23 +256,3 @@ impl<T> From<EvalAltResult> for Result<T, Box<EvalAltResult>> {
Err(err.into())
}
}
impl AST {
/// _(internals)_ Get the internal [`Module`] containing all script-defined functions.
/// Exported under the `internals` feature only.
///
/// Not available under `no_function`.
///
/// # Deprecated
///
/// This method is deprecated. Use [`shared_lib`][AST::shared_lib] instead.
///
/// This method will be removed in the next major version.
#[deprecated(since = "1.3.0", note = "use `shared_lib` instead")]
#[cfg(feature = "internals")]
#[inline(always)]
#[must_use]
pub fn lib(&self) -> &Module {
&self.functions
}
}

View File

@ -29,21 +29,21 @@ pub struct Limits {
pub max_function_expr_depth: Option<NonZeroUsize>,
/// Maximum number of operations allowed to run.
pub max_operations: Option<std::num::NonZeroU64>,
/// Maximum number of [modules][Module] allowed to load.
/// Maximum number of [modules][crate::Module] allowed to load.
///
/// Set to zero to effectively disable loading any [module][Module].
/// Set to zero to effectively disable loading any [module][crate::Module].
///
/// Not available under `no_module`.
#[cfg(not(feature = "no_module"))]
pub max_modules: usize,
/// Maximum length of a [string][ImmutableString].
/// Maximum length of a [string][crate::ImmutableString].
pub max_string_size: Option<NonZeroUsize>,
/// Maximum length of an [array][Array].
/// Maximum length of an [array][crate::Array].
///
/// Not available under `no_index`.
#[cfg(not(feature = "no_index"))]
pub max_array_size: Option<NonZeroUsize>,
/// Maximum number of properties in an [object map][Map].
/// Maximum number of properties in an [object map][crate::Map].
///
/// Not available under `no_object`.
#[cfg(not(feature = "no_object"))]

View File

@ -2442,3 +2442,23 @@ impl Expr {
true
}
}
impl AST {
/// _(internals)_ Get the internal [`Module`] containing all script-defined functions.
/// Exported under the `internals` feature only.
///
/// Not available under `no_function`.
///
/// # Deprecated
///
/// This method is deprecated. Use [`shared_lib`][AST::shared_lib] instead.
///
/// This method will be removed in the next major version.
#[deprecated(since = "1.3.0", note = "use `shared_lib` instead")]
#[cfg(feature = "internals")]
#[inline(always)]
#[must_use]
pub fn lib(&self) -> &crate::Module {
&self.functions
}
}

View File

@ -216,7 +216,7 @@ pub use engine::{EvalState, FnResolutionCache, FnResolutionCacheEntry, Imports};
#[cfg(feature = "internals")]
#[cfg(not(feature = "unchecked"))]
pub use engine::Limits;
pub use api::limits::Limits;
#[cfg(feature = "internals")]
pub use module::NamespaceRef;

View File

@ -2241,7 +2241,7 @@ impl Engine {
#[must_use]
pub fn lex<'a>(
&'a self,
input: impl IntoIterator<Item = &'a (AsRef<str> + 'a)>,
input: impl IntoIterator<Item = &'a (impl AsRef<str> + 'a)>,
) -> (TokenIterator<'a>, TokenizerControl) {
self.lex_raw(input, None)
}
@ -2252,7 +2252,7 @@ impl Engine {
#[must_use]
pub fn lex_with_map<'a>(
&'a self,
input: impl IntoIterator<Item = &'a (AsRef<str> + 'a)>,
input: impl IntoIterator<Item = &'a (impl AsRef<str> + 'a)>,
token_mapper: &'a OnParseTokenCallback,
) -> (TokenIterator<'a>, TokenizerControl) {
self.lex_raw(input, Some(token_mapper))