Skip to content

Commit

Permalink
Revert and fix feature detection
Browse files Browse the repository at this point in the history
  • Loading branch information
philss committed Jan 1, 2024
1 parent 6c54025 commit d61e4bc
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions rustler/src/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,10 @@ impl From<ErlNifTermType> for TermType {
}
}

#[cfg(feature = "nif_version_2_15")]
pub fn get_type(term: Term) -> TermType {
term.get_erl_type().into()
}

#[cfg(not(feature = "nif_version_2_15"))]
pub fn get_type(term: Term) -> TermType {
if term.is_atom() {
if cfg!(feature = "nif_version_2_15") {
term.get_erl_type().into()
} else if term.is_atom() {
TermType::Atom
} else if term.is_binary() {
TermType::Binary
Expand Down

0 comments on commit d61e4bc

Please sign in to comment.