You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instead, make all methods have an overload write to an IO, and the other overload which returns Bytes just creates an IO::Memory and calls the other overload.
defself.encode(anything)
io =IO::Memory.new
encode(anything, io)
io.to_slice # maybe add dup hereenddefself.encode(b : Bytes, io)
# encode b into ioend# and so on for other types
avoid
Rlp::Util.binary_add
's segmentedIO
operationsinstead, make all methods have an overload write to an
IO
, and the other overload which returnsBytes
just creates anIO::Memory
and calls the other overload.ref https://www.reddit.com/r/crystal_programming/comments/ev2xig/wrote_a_native_library_implementing_rlp_recursive/
ref https://github.com/crystal-lang/crystal/blob/47bdbaa4d1638c76137bfa12de86eac454a15908/src/object.cr#L94-L105
The text was updated successfully, but these errors were encountered: