You can just call iolist_to_binary directly, no need for erlang: