Skip to content

Commit

Permalink
Drop deprecated functionality (#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor authored May 3, 2024
1 parent 6bd2a80 commit 02960de
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 297 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ members = [
"rustler_tests/native/rustler_test",
"rustler_tests/native/rustler_bigint_test",
"rustler_tests/native/rustler_serde_test",
"rustler_tests/native/deprecated_macros",
"rustler_tests/native/dynamic_load",
"rustler_tests/native/rustler_compile_tests",
"rustler_benchmarks/native/benchmark",
Expand Down
148 changes: 0 additions & 148 deletions rustler/src/export.rs

This file was deleted.

1 change: 0 additions & 1 deletion rustler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub mod thread;
pub use crate::thread::{spawn, JobSpawner, ThreadSpawner};

pub mod error;
pub mod export;
pub use crate::error::Error;

pub mod r#return;
Expand Down
8 changes: 0 additions & 8 deletions rustler/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,6 @@ where
}
}

#[macro_export]
#[deprecated(since = "0.22.0", note = "Please use `resource!` instead.")]
macro_rules! resource_struct_init {
($struct_name:ty, $env: ident) => {
$crate::resource!($struct_name, $env)
};
}

#[macro_export]
macro_rules! resource {
($struct_name:ty, $env: ident) => {
Expand Down
38 changes: 0 additions & 38 deletions rustler/src/types/atom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,44 +226,6 @@ macro_rules! atoms {
};
}

#[macro_export]
#[deprecated(since = "0.22.0", note = "Please use `atoms!` instead.")]
macro_rules! rustler_atoms {
{
$(
$( #[$attr:meta] )*
atom $name:ident $( = $str:expr )?;
)*
} => {
#[allow(non_snake_case)]
struct RustlerAtoms {
$( $name : $crate::types::atom::Atom ),*
}
$crate::lazy_static::lazy_static! {
static ref RUSTLER_ATOMS: RustlerAtoms = $crate::env::OwnedEnv::new().run(|env| {
RustlerAtoms {
$( $name: $crate::rustler_atoms!(@internal_make_atom(env, $name $( = $str)? )) ),*
}
});
}
$(
$( #[$attr] )*
pub fn $name() -> $crate::types::atom::Atom {
RUSTLER_ATOMS.$name
}
)*
};

// Internal helper macros.
{ @internal_make_atom($env:ident, $name:ident) } => {
$crate::rustler_atoms!(@internal_make_atom($env, $name = stringify!($name)))
};
{ @internal_make_atom($env:ident, $name:ident = $str:expr) } => {
$crate::types::atom::Atom::from_str($env, $str)
.expect("rustler::atoms!: bad atom string")
};
}

atoms! {
/// The `nif_panicked` atom.
nif_panicked,
Expand Down
8 changes: 0 additions & 8 deletions rustler/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ pub mod tuple;
pub mod local_pid;
pub use self::local_pid::LocalPid;

#[deprecated(since = "0.22.0", note = "Please use local_pid instead")]
pub mod pid {
#[deprecated(since = "0.22.0", note = "Please use LocalPid instead")]
pub use super::LocalPid as Pid;
}
#[deprecated(since = "0.22.0", note = "Please use LocalPid instead")]
pub use self::LocalPid as Pid;

pub mod truthy;

pub mod elixir_struct;
Expand Down
19 changes: 0 additions & 19 deletions rustler_mix/lib/mix/tasks/compile.rustler.ex

This file was deleted.

21 changes: 0 additions & 21 deletions rustler_mix/lib/rustler/compiler/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ defmodule Rustler.Compiler.Config do
def from(otp_app, config, opts) do
crate = config[:crate] || opts[:crate] || otp_app

# TODO: Remove in 1.0
rustler_crates =
if mix_config = Mix.Project.config()[:rustler_crates] do
IO.warn(
":rustler_crates in mix.exs is deprecated, please explicitly pass options on `use Rustler` or configure the module in your `config/*.exs` files"
)

mix_config
else
[]
end

legacy_config = rustler_crates[to_atom(crate)] || []

defaults = %Config{
crate: crate,
load_from: {otp_app, "priv/native/lib#{crate}"},
Expand All @@ -61,7 +47,6 @@ defmodule Rustler.Compiler.Config do
defaults
|> Map.from_struct()
|> Enum.into([])
|> Keyword.merge(legacy_config)
|> Keyword.merge(opts)
|> Keyword.merge(config)
|> build()
Expand Down Expand Up @@ -147,10 +132,4 @@ defmodule Rustler.Compiler.Config do
|> Enum.filter(&(&1["name"] == name))
|> List.first()
end

defp to_atom(name) when is_binary(name),
do: String.to_atom(name)

defp to_atom(name) when is_atom(name),
do: name
end
7 changes: 0 additions & 7 deletions rustler_tests/lib/deprecated_macros.ex

This file was deleted.

13 changes: 0 additions & 13 deletions rustler_tests/native/deprecated_macros/Cargo.toml

This file was deleted.

33 changes: 0 additions & 33 deletions rustler_tests/native/deprecated_macros/src/lib.rs

This file was deleted.

0 comments on commit 02960de

Please sign in to comment.