diff --git a/rustler_benchmarks/native/benchmark/src/nif_various.rs b/rustler_benchmarks/native/benchmark/src/nif_various.rs index 8a75996b..79772272 100644 --- a/rustler_benchmarks/native/benchmark/src/nif_various.rs +++ b/rustler_benchmarks/native/benchmark/src/nif_various.rs @@ -50,28 +50,31 @@ pub enum TaggedEnum { } #[rustler::nif] -pub fn decode_term(_input: Term) -> NifResult { - Ok(true) +pub fn decode_term(input: Term) -> NifResult { + Ok(!input.is_atom()) } #[rustler::nif] -pub fn decode_string(_input: String) -> NifResult { - Ok(true) +pub fn decode_string(input: String) -> NifResult { + Ok(!input.is_empty()) } #[rustler::nif] -pub fn decode_struct_string(_input: TestStructString) -> NifResult { - Ok(true) +pub fn decode_struct_string(input: TestStructString) -> NifResult { + Ok(!input.a.is_empty()) } #[rustler::nif] -pub fn decode_struct(_input: TestStruct) -> NifResult { - Ok(true) +pub fn decode_struct(input: TestStruct) -> NifResult { + Ok(input.d) } #[rustler::nif] -pub fn decode_tagged_enum(_input: TaggedEnum) -> NifResult { - Ok(true) +pub fn decode_tagged_enum(input: TaggedEnum) -> NifResult { + match input { + TaggedEnum::UnitA => Ok(true), + _ => Ok(false), + } } #[rustler::nif]