cannon
cannon copied to clipboard
Time does not serialize correctly in Crystal .34
I think if you want to make a time with seconds now you now need to do something like this:
crystal
struct Time
def self.from_cannon_io(io)
utc(seconds: Cannon.decode(io, Int64), nanoseconds: 0)
end
def self.to_cannon_io(io)
io.write_bytes self
io
end
end
Basically I think you need to specify a location now. The simplest way is to use UTC.
There might be others too.
Opened a PR with what I think to be an ok fix. There should probably be Time's added to the specs if there isnt already though.