Skip to content

Commit 02960de

Browse files
authored
Drop deprecated functionality (#604)
1 parent 6bd2a80 commit 02960de

File tree

11 files changed

+0
-297
lines changed

11 files changed

+0
-297
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ members = [
88
"rustler_tests/native/rustler_test",
99
"rustler_tests/native/rustler_bigint_test",
1010
"rustler_tests/native/rustler_serde_test",
11-
"rustler_tests/native/deprecated_macros",
1211
"rustler_tests/native/dynamic_load",
1312
"rustler_tests/native/rustler_compile_tests",
1413
"rustler_benchmarks/native/benchmark",

rustler/src/export.rs

Lines changed: 0 additions & 148 deletions
This file was deleted.

rustler/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ pub mod thread;
6060
pub use crate::thread::{spawn, JobSpawner, ThreadSpawner};
6161

6262
pub mod error;
63-
pub mod export;
6463
pub use crate::error::Error;
6564

6665
pub mod r#return;

rustler/src/resource.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,6 @@ where
261261
}
262262
}
263263

264-
#[macro_export]
265-
#[deprecated(since = "0.22.0", note = "Please use `resource!` instead.")]
266-
macro_rules! resource_struct_init {
267-
($struct_name:ty, $env: ident) => {
268-
$crate::resource!($struct_name, $env)
269-
};
270-
}
271-
272264
#[macro_export]
273265
macro_rules! resource {
274266
($struct_name:ty, $env: ident) => {

rustler/src/types/atom.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -226,44 +226,6 @@ macro_rules! atoms {
226226
};
227227
}
228228

229-
#[macro_export]
230-
#[deprecated(since = "0.22.0", note = "Please use `atoms!` instead.")]
231-
macro_rules! rustler_atoms {
232-
{
233-
$(
234-
$( #[$attr:meta] )*
235-
atom $name:ident $( = $str:expr )?;
236-
)*
237-
} => {
238-
#[allow(non_snake_case)]
239-
struct RustlerAtoms {
240-
$( $name : $crate::types::atom::Atom ),*
241-
}
242-
$crate::lazy_static::lazy_static! {
243-
static ref RUSTLER_ATOMS: RustlerAtoms = $crate::env::OwnedEnv::new().run(|env| {
244-
RustlerAtoms {
245-
$( $name: $crate::rustler_atoms!(@internal_make_atom(env, $name $( = $str)? )) ),*
246-
}
247-
});
248-
}
249-
$(
250-
$( #[$attr] )*
251-
pub fn $name() -> $crate::types::atom::Atom {
252-
RUSTLER_ATOMS.$name
253-
}
254-
)*
255-
};
256-
257-
// Internal helper macros.
258-
{ @internal_make_atom($env:ident, $name:ident) } => {
259-
$crate::rustler_atoms!(@internal_make_atom($env, $name = stringify!($name)))
260-
};
261-
{ @internal_make_atom($env:ident, $name:ident = $str:expr) } => {
262-
$crate::types::atom::Atom::from_str($env, $str)
263-
.expect("rustler::atoms!: bad atom string")
264-
};
265-
}
266-
267229
atoms! {
268230
/// The `nif_panicked` atom.
269231
nif_panicked,

rustler/src/types/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ pub mod tuple;
3131
pub mod local_pid;
3232
pub use self::local_pid::LocalPid;
3333

34-
#[deprecated(since = "0.22.0", note = "Please use local_pid instead")]
35-
pub mod pid {
36-
#[deprecated(since = "0.22.0", note = "Please use LocalPid instead")]
37-
pub use super::LocalPid as Pid;
38-
}
39-
#[deprecated(since = "0.22.0", note = "Please use LocalPid instead")]
40-
pub use self::LocalPid as Pid;
41-
4234
pub mod truthy;
4335

4436
pub mod elixir_struct;

rustler_mix/lib/mix/tasks/compile.rustler.ex

Lines changed: 0 additions & 19 deletions
This file was deleted.

rustler_mix/lib/rustler/compiler/config.ex

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,6 @@ defmodule Rustler.Compiler.Config do
3535
def from(otp_app, config, opts) do
3636
crate = config[:crate] || opts[:crate] || otp_app
3737

38-
# TODO: Remove in 1.0
39-
rustler_crates =
40-
if mix_config = Mix.Project.config()[:rustler_crates] do
41-
IO.warn(
42-
":rustler_crates in mix.exs is deprecated, please explicitly pass options on `use Rustler` or configure the module in your `config/*.exs` files"
43-
)
44-
45-
mix_config
46-
else
47-
[]
48-
end
49-
50-
legacy_config = rustler_crates[to_atom(crate)] || []
51-
5238
defaults = %Config{
5339
crate: crate,
5440
load_from: {otp_app, "priv/native/lib#{crate}"},
@@ -61,7 +47,6 @@ defmodule Rustler.Compiler.Config do
6147
defaults
6248
|> Map.from_struct()
6349
|> Enum.into([])
64-
|> Keyword.merge(legacy_config)
6550
|> Keyword.merge(opts)
6651
|> Keyword.merge(config)
6752
|> build()
@@ -147,10 +132,4 @@ defmodule Rustler.Compiler.Config do
147132
|> Enum.filter(&(&1["name"] == name))
148133
|> List.first()
149134
end
150-
151-
defp to_atom(name) when is_binary(name),
152-
do: String.to_atom(name)
153-
154-
defp to_atom(name) when is_atom(name),
155-
do: name
156135
end

rustler_tests/lib/deprecated_macros.ex

Lines changed: 0 additions & 7 deletions
This file was deleted.

rustler_tests/native/deprecated_macros/Cargo.toml

Lines changed: 0 additions & 13 deletions
This file was deleted.

rustler_tests/native/deprecated_macros/src/lib.rs

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)