Remove deprecated API.
This commit is contained in:
parent
02e886e33b
commit
178fe6b978
@ -1825,23 +1825,6 @@ impl Dynamic {
|
|||||||
/// Convert the [`Dynamic`] into a [`String`] and return it.
|
/// Convert the [`Dynamic`] into a [`String`] and return it.
|
||||||
/// If there are other references to the same string, a cloned copy is returned.
|
/// 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.
|
/// 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<String, &'static str> {
|
|
||||||
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)]
|
#[inline(always)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn as_string(self) -> Result<String, &'static str> {
|
pub fn as_string(self) -> Result<String, &'static str> {
|
||||||
@ -1849,22 +1832,6 @@ impl Dynamic {
|
|||||||
}
|
}
|
||||||
/// Convert the [`Dynamic`] into an [`ImmutableString`] and return it.
|
/// Convert the [`Dynamic`] into an [`ImmutableString`] and return it.
|
||||||
/// Returns the name of the actual type if the cast fails.
|
/// 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<ImmutableString, &'static str> {
|
|
||||||
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)]
|
#[inline(always)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn as_immutable_string(self) -> Result<ImmutableString, &'static str> {
|
pub fn as_immutable_string(self) -> Result<ImmutableString, &'static str> {
|
||||||
|
@ -903,14 +903,6 @@ impl Engine {
|
|||||||
self.global_modules.insert(0, module);
|
self.global_modules.insert(0, module);
|
||||||
self
|
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<Shared<Module>>) -> &mut Self {
|
|
||||||
self.register_global_module(module.into())
|
|
||||||
}
|
|
||||||
/// Register a shared [`Module`] as a static module namespace with the [`Engine`].
|
/// Register a shared [`Module`] as a static module namespace with the [`Engine`].
|
||||||
///
|
///
|
||||||
/// Functions marked [`FnNamespace::Global`] and type iterators are exposed to scripts without
|
/// Functions marked [`FnNamespace::Global`] and type iterators are exposed to scripts without
|
||||||
@ -999,19 +991,6 @@ impl Engine {
|
|||||||
self
|
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<str> + Into<Identifier>,
|
|
||||||
module: impl Into<Shared<Module>>,
|
|
||||||
) -> &mut Self {
|
|
||||||
self.register_static_module(name, module.into())
|
|
||||||
}
|
|
||||||
/// Compile a string into an [`AST`], which can be used later for evaluation.
|
/// Compile a string into an [`AST`], which can be used later for evaluation.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
|
16
src/lib.rs
16
src/lib.rs
@ -141,22 +141,6 @@ pub use module::{FnNamespace, Module};
|
|||||||
pub use scope::Scope;
|
pub use scope::Scope;
|
||||||
pub use token::Position;
|
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
|
/// 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.
|
/// identifiers are ASCII and short, fewer than 23 characters, so they can be stored inline.
|
||||||
#[cfg(not(feature = "internals"))]
|
#[cfg(not(feature = "internals"))]
|
||||||
|
@ -40,15 +40,6 @@ pub trait Package {
|
|||||||
/// Retrieve the generic package library from this package.
|
/// Retrieve the generic package library from this package.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
fn as_shared_module(&self) -> Shared<Module>;
|
fn as_shared_module(&self) -> Shared<Module>;
|
||||||
|
|
||||||
/// 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<Module> {
|
|
||||||
self.as_shared_module()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Macro that makes it easy to define a _package_ (which is basically a shared [module][Module])
|
/// Macro that makes it easy to define a _package_ (which is basically a shared [module][Module])
|
||||||
|
Loading…
Reference in New Issue
Block a user