Skip to content

Commit

Permalink
force execution
Browse files Browse the repository at this point in the history
  • Loading branch information
cleaton committed Oct 9, 2023
1 parent a28ee56 commit 9748d16
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions rustler_benchmarks/native/benchmark/src/nif_various.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,31 @@ pub enum TaggedEnum {
}

#[rustler::nif]
pub fn decode_term(_input: Term) -> NifResult<bool> {
Ok(true)
pub fn decode_term(input: Term) -> NifResult<bool> {
Ok(!input.is_atom())
}

#[rustler::nif]
pub fn decode_string(_input: String) -> NifResult<bool> {
Ok(true)
pub fn decode_string(input: String) -> NifResult<bool> {
Ok(!input.is_empty())
}

#[rustler::nif]
pub fn decode_struct_string(_input: TestStructString) -> NifResult<bool> {
Ok(true)
pub fn decode_struct_string(input: TestStructString) -> NifResult<bool> {
Ok(!input.a.is_empty())
}

#[rustler::nif]
pub fn decode_struct(_input: TestStruct) -> NifResult<bool> {
Ok(true)
pub fn decode_struct(input: TestStruct) -> NifResult<bool> {
Ok(input.d)
}

#[rustler::nif]
pub fn decode_tagged_enum(_input: TaggedEnum) -> NifResult<bool> {
Ok(true)
pub fn decode_tagged_enum(input: TaggedEnum) -> NifResult<bool> {
match input {
TaggedEnum::UnitA => Ok(true),
_ => Ok(false),
}
}

#[rustler::nif]
Expand Down

0 comments on commit 9748d16

Please sign in to comment.