Skip to content

Commit e37a838

Browse files
committed
Return tuple not list
1 parent 9409e29 commit e37a838

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/components_guide/rustler/math.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ defmodule ComponentsGuide.Rustler.Math do
2929
def wasm_example(source, f, a), do: wasm_example_1_i32(source, f, a)
3030
def wasm_example(source, f, a, b), do: wasm_example_2_i32(source, f, a, b)
3131

32-
def wasm_buffer(source, f, a, b), do: wasm_buffer_2_i32(source, f, a, b)
32+
def wasm_buffer(source, f, a, b), do: wasm_buffer_2_i32(source, f, a, b) |> List.to_tuple()
3333
def wasm_string(source, f, a, b), do: wasm_string_2_i32(source, f, a, b)
3434

3535
defp error, do: :erlang.nif_error(:nif_not_loaded)

test/components_guide/rustler/math_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ defmodule ComponentsGuide.Rustler.MathTest do
107107
)
108108
"""
109109

110-
assert Math.wasm_buffer(wasm_source, "main", 0, 0) == [256, 30]
110+
assert Math.wasm_buffer(wasm_source, "main", 0, 0) == {256, 30}
111111
assert Math.wasm_string(wasm_source, "main", 0, 0) == "Know the length of this string"
112112
end
113113

0 commit comments

Comments
 (0)