Skip to content

Commit a92f191

Browse files
cleatonfilmor
authored andcommitted
force execution
1 parent a2482a3 commit a92f191

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

rustler_benchmarks/native/benchmark/src/nif_various.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,31 @@ pub enum TaggedEnum {
5050
}
5151

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

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

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

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

7272
#[rustler::nif]
73-
pub fn decode_tagged_enum(_input: TaggedEnum) -> NifResult<bool> {
74-
Ok(true)
73+
pub fn decode_tagged_enum(input: TaggedEnum) -> NifResult<bool> {
74+
match input {
75+
TaggedEnum::UnitA => Ok(true),
76+
_ => Ok(false),
77+
}
7578
}
7679

7780
#[rustler::nif]

0 commit comments

Comments
 (0)