diff --git a/src/engine_api.rs b/src/engine_api.rs index 131bcc6e..8703d3d0 100644 --- a/src/engine_api.rs +++ b/src/engine_api.rs @@ -859,12 +859,10 @@ impl Engine { self } /// Register a shared [`Module`] into the global namespace of [`Engine`]. - /// - /// # Deprecated - /// + /// This function is deprecated and will be removed in the future. /// Use [`register_global_module`][Engine::register_global_module] instead. #[inline(always)] - #[deprecated = "use `register_global_module` instead"] + #[deprecated(since = "0.19.9", note = "use `register_global_module` instead")] pub fn load_package(&mut self, module: impl Into>) -> &mut Self { self.register_global_module(module.into()) } @@ -947,13 +945,11 @@ impl Engine { } /// Register a shared [`Module`] as a static module namespace with the [`Engine`]. - /// - /// # Deprecated - /// + /// This function is deprecated and will be removed in the future. /// Use [`register_static_module`][Engine::register_static_module] instead. #[cfg(not(feature = "no_module"))] #[inline(always)] - #[deprecated = "use `register_static_module` instead"] + #[deprecated(since = "0.19.9", note = "use `register_static_module` instead")] pub fn register_module( &mut self, name: impl AsRef + Into, diff --git a/src/lib.rs b/src/lib.rs index 3a880f4d..87996279 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -135,6 +135,22 @@ pub use syntax::Expression; pub use token::Position; pub use utils::ImmutableString; +/// A trait to enable registering Rust functions. +/// This trait is no longer needed and will be removed in the future. +#[deprecated( + since = "0.19.15", + note = "this trait is no longer needed and will be removed in the future" +)] +pub trait RegisterFn {} + +/// A trait to enable registering Rust functions. +/// This trait is no longer needed and will be removed in the future. +#[deprecated( + since = "0.19.15", + note = "this trait is no longer needed and will be removed in the future" +)] +pub trait RegisterResultFn {} + /// Alias to [`Rc`][std::rc::Rc] or [`Arc`][std::sync::Arc] depending on the `sync` feature flag. pub use fn_native::Shared; @@ -208,9 +224,9 @@ pub use engine::Limits; pub use module::NamespaceRef; /// Alias to [`smallvec::SmallVec<[T; 4]>`](https://crates.io/crates/smallvec), which is a -/// specialized [`Vec`] backed by a small, inline, fixed-size array when there are <= 4 items stored. +/// specialized [`Vec`] backed by a small, inline, fixed-size array when there are ≤ 4 items stored. /// -/// # Background +/// # History /// /// And Saint Attila raised the `SmallVec` up on high, saying, "O Lord, bless this Thy `SmallVec` /// that, with it, Thou mayest blow Thine allocation costs to tiny bits in Thy mercy." @@ -235,17 +251,17 @@ pub use module::NamespaceRef; /// in that matter) contain fewer than 5 arguments, the exception being closures that capture a /// large number of external variables. /// -/// In addition, most scripts blocks either contain many statements, or just a few lines; +/// In addition, most script blocks either contain many statements, or just a few lines; /// most scripts load fewer than 5 external modules; most module paths contain fewer than 5 levels /// (e.g. `std::collections::map::HashMap` is 4 levels, and that's already quite long). #[cfg(not(feature = "internals"))] type StaticVec = smallvec::SmallVec<[T; 4]>; /// _(INTERNALS)_ Alias to [`smallvec`](https://crates.io/crates/smallvec), which is a specialized -/// [`Vec`] backed by a small, inline, fixed-size array when there are <= 4 items stored. +/// [`Vec`] backed by a small, inline, fixed-size array when there are ≤ 4 items stored. /// Exported under the `internals` feature only. /// -/// # Background +/// # History /// /// And Saint Attila raised the `SmallVec` up on high, saying, "O Lord, bless this Thy `SmallVec` /// that, with it, Thou mayest blow Thine allocation costs to tiny bits in Thy mercy." @@ -270,7 +286,7 @@ type StaticVec = smallvec::SmallVec<[T; 4]>; /// in that matter) contain fewer than 5 arguments, the exception being closures that capture a /// large number of external variables. /// -/// In addition, most scripts blocks either contain many statements, or just a few lines; +/// In addition, most script blocks either contain many statements, or just a few lines; /// most scripts load fewer than 5 external modules; most module paths contain fewer than 5 levels /// (e.g. `std::collections::map::HashMap` is 4 levels, and that's already quite long). #[cfg(feature = "internals")] diff --git a/src/packages/mod.rs b/src/packages/mod.rs index 7524ec3d..145eabf0 100644 --- a/src/packages/mod.rs +++ b/src/packages/mod.rs @@ -40,11 +40,9 @@ pub trait Package { fn as_shared_module(&self) -> Shared; /// Retrieve the generic package library from this package. - /// - /// # Deprecated - /// + /// This method is deprecated and will be removed in the future. /// Use [`as_shared_module`][Package::as_shared_module] instead. - #[deprecated = "use `as_shared_module` instead"] + #[deprecated(since = "0.19.9", note = "use `as_shared_module` instead")] fn get(&self) -> Shared { self.as_shared_module() }