warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> src/zip.rs:22:5
|
21 | pub fn load(env: Env, _: Term) -> bool {
| -------------------------------------- move the `impl` block outside of this function `load`
22 | rustler::resource!(WriterResource, env);
| ^^^^^^^^^^^^^^^^^^^--------------^^^^^^
| | |
| | `WriterResource` is not local
| `ResourceTypeProvider` is not local
|
= note: the macro `rustler::resource` defines the non-local `impl`, and may need to be changed
= note: the macro `rustler::resource` may come from an old version of the `rustler` crate, try updating your dependency with `cargo update -p rustler`
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
= note: `#[warn(non_local_definitions)]` on by default
= note: this warning originates in the macro `rustler::resource` (in Nightly builds, run with -Z macro-backtrace for more info)
The macro likely should be deprecated and a new version added to define a function and the top-level impl block separately.
The macro likely should be deprecated and a new version added to define a function and the top-level impl block separately.