In #6, @halostatue pointed out that the declaration of write/3 said that it accepted any iodata. The recommended solution was to call IO.iodata_to_binary/1 on the incoming content.
I tried to write a test for this behavior, but the test ended up looking like this:
That test passes for the disk and S3 adapters, but fails for the memory adapter, so we'd have to also convert to binary there as well.
I don't love that you put in iodata, but get out a binary. Instead, I think it is simpler to just say that write/3 and read/2 only operate on binary data. People using this library can simply call IO.iodata_to_binary/1 before calling write.
In #6, @halostatue pointed out that the declaration of
write/3
said that it accepted any iodata. The recommended solution was to callIO.iodata_to_binary/1
on the incoming content.I tried to write a test for this behavior, but the test ended up looking like this:
That test passes for the disk and S3 adapters, but fails for the memory adapter, so we'd have to also convert to binary there as well.
I don't love that you put in iodata, but get out a binary. Instead, I think it is simpler to just say that
write/3
andread/2
only operate on binary data. People using this library can simply callIO.iodata_to_binary/1
before calling write.Closes #6