From 178fe6b978b986bd45d0995275e403c2445e0473 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 24 Jun 2021 09:48:44 +0800 Subject: [PATCH] Remove deprecated API. --- src/dynamic.rs | 33 --------------------------------- src/engine_api.rs | 21 --------------------- src/lib.rs | 16 ---------------- src/packages/mod.rs | 9 --------- 4 files changed, 79 deletions(-) diff --git a/src/dynamic.rs b/src/dynamic.rs index 7c876431..49d5de9d 100644 --- a/src/dynamic.rs +++ b/src/dynamic.rs @@ -1825,23 +1825,6 @@ impl Dynamic { /// Convert the [`Dynamic`] into a [`String`] and return it. /// If there are other references to the same string, a cloned copy is returned. /// Returns the name of the actual type if the cast fails. - /// - /// # Deprecated - /// - /// This method is deprecated and will be removed in the future. - /// Use [`as_string`][Dynamic::as_string] instead. - #[inline(always)] - #[must_use] - #[deprecated( - since = "0.20.3", - note = "this method is deprecated and will be removed in the future" - )] - pub fn take_string(self) -> Result { - self.as_string() - } - /// Convert the [`Dynamic`] into a [`String`] and return it. - /// If there are other references to the same string, a cloned copy is returned. - /// Returns the name of the actual type if the cast fails. #[inline(always)] #[must_use] pub fn as_string(self) -> Result { @@ -1849,22 +1832,6 @@ impl Dynamic { } /// Convert the [`Dynamic`] into an [`ImmutableString`] and return it. /// Returns the name of the actual type if the cast fails. - /// - /// # Deprecated - /// - /// This method is deprecated and will be removed in the future. - /// Use [`as_immutable_string`][Dynamic::as_immutable_string] instead. - #[inline(always)] - #[must_use] - #[deprecated( - since = "0.20.3", - note = "this method is deprecated and will be removed in the future" - )] - pub fn take_immutable_string(self) -> Result { - self.as_immutable_string() - } - /// Convert the [`Dynamic`] into an [`ImmutableString`] and return it. - /// Returns the name of the actual type if the cast fails. #[inline(always)] #[must_use] pub fn as_immutable_string(self) -> Result { diff --git a/src/engine_api.rs b/src/engine_api.rs index c0052d75..3b8149ca 100644 --- a/src/engine_api.rs +++ b/src/engine_api.rs @@ -903,14 +903,6 @@ impl Engine { self.global_modules.insert(0, module); self } - /// Register a shared [`Module`] into the global namespace of [`Engine`]. - /// This function is deprecated and will be removed in the future. - /// Use [`register_global_module`][Engine::register_global_module] instead. - #[inline(always)] - #[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()) - } /// Register a shared [`Module`] as a static module namespace with the [`Engine`]. /// /// Functions marked [`FnNamespace::Global`] and type iterators are exposed to scripts without @@ -999,19 +991,6 @@ impl Engine { self } - /// Register a shared [`Module`] as a static module namespace with the [`Engine`]. - /// 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(since = "0.19.9", note = "use `register_static_module` instead")] - pub fn register_module( - &mut self, - name: impl AsRef + Into, - module: impl Into>, - ) -> &mut Self { - self.register_static_module(name, module.into()) - } /// Compile a string into an [`AST`], which can be used later for evaluation. /// /// # Example diff --git a/src/lib.rs b/src/lib.rs index 669ff9ac..905e5655 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -141,22 +141,6 @@ pub use module::{FnNamespace, Module}; pub use scope::Scope; pub use token::Position; -/// 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 {} - /// An identifier in Rhai. [`SmartString`](https://crates.io/crates/smartstring) is used because most /// identifiers are ASCII and short, fewer than 23 characters, so they can be stored inline. #[cfg(not(feature = "internals"))] diff --git a/src/packages/mod.rs b/src/packages/mod.rs index 5e9b335d..f3705088 100644 --- a/src/packages/mod.rs +++ b/src/packages/mod.rs @@ -40,15 +40,6 @@ pub trait Package { /// Retrieve the generic package library from this package. #[must_use] fn as_shared_module(&self) -> Shared; - - /// Retrieve the generic package library from this package. - /// This method is deprecated and will be removed in the future. - /// Use [`as_shared_module`][Package::as_shared_module] instead. - #[must_use] - #[deprecated(since = "0.19.9", note = "use `as_shared_module` instead")] - fn get(&self) -> Shared { - self.as_shared_module() - } } /// Macro that makes it easy to define a _package_ (which is basically a shared [module][Module])