Skip to content

Commit

Permalink
Unconditionally enable derive, update changelog and upgrade docs
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor committed Jun 7, 2024
1 parent e8881a3 commit ae70d92
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ versions.

### Added

- Resource types can now be registered implicitly via a `#[derive(Resource)]`
instead of explicit registration in a `load` function using
`rustler::resource!` (#617)

### Fixed

### Changed
Expand Down
6 changes: 6 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ This document is intended to simplify upgrading to newer versions by extending t
1. NIF implementations are now discovered automatically, the respective argument
in the `rustler::init!` macro should be removed. If a NIF implementation
should not be exported, it must be disabled with a `#[cfg]` marker.
2. The functionality related to the `derive` feature is now unconditionally
active. The feature flag is kept for compatibility for now but will be
removed in the future.
3. To register a type as a resource, the new `#[derive(Resource)]` can be used
now. It is implicitly registered and does not require (or work in) the old
explicit registration with `rustler::resource!` a custom `load` function.

## 0.32 -> 0.33

Expand Down
6 changes: 3 additions & 3 deletions rustler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ rust-version = "1.70"

[features]
big_integer = ["dep:num-bigint"]
default = ["derive", "nif_version_2_15"]
derive = ["rustler_codegen"]
default = ["nif_version_2_15"]
derive = []
alternative_nif_init_name = []
allocator = []
nif_version_2_14 = ["rustler_sys/nif_version_2_14"]
Expand All @@ -23,7 +23,7 @@ serde = ["dep:serde"]

[dependencies]
inventory = "0.3"
rustler_codegen = { path = "../rustler_codegen", version = "0.33.0", optional = true}
rustler_codegen = { path = "../rustler_codegen", version = "0.33.0" }
rustler_sys = { path = "../rustler_sys", version = "~2.4.1" }
num-bigint = { version = "0.4", optional = true }
serde = { version = "1", optional = true }
Expand Down
1 change: 0 additions & 1 deletion rustler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ pub use nif::Nif;

pub type NifResult<T> = Result<T, Error>;

#[cfg(feature = "derive")]
pub use rustler_codegen::{
init, nif, NifException, NifMap, NifRecord, NifStruct, NifTaggedEnum, NifTuple, NifUnitEnum,
NifUntaggedEnum, Resource,
Expand Down

0 comments on commit ae70d92

Please sign in to comment.