From ba6cd2a1ecfd82e2088d189581d19fe9a7c08ff7 Mon Sep 17 00:00:00 2001 From: Philip Sampaio Date: Mon, 1 Jan 2024 13:53:05 -0300 Subject: [PATCH] Revert and fix feature detection --- rustler/src/dynamic.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/rustler/src/dynamic.rs b/rustler/src/dynamic.rs index 41e92817..0a3996f0 100644 --- a/rustler/src/dynamic.rs +++ b/rustler/src/dynamic.rs @@ -42,14 +42,10 @@ impl From 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