sharksforarms / deku

Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Apache License 2.0
1.14k stars 55 forks source link

Implement `DekuWrite` for `[T]` #270

Closed constfold closed 10 months ago

constfold commented 2 years ago

Currently we alreay have DekuWrite for &[T], I think there is no reason to not have DekuWrite on [T]. I found this would be convenience while write codes like:

self.0.as_ref().write(output, ()) // not work, type annotations needed
<&[u8]>::write(self.0.as_ref(), output, ()) // not work either
<&[u8]>::write(&self.0.as_ref(), output, ()) // works
<[u8]>::write(self.0.as_ref(), output, ()) // works
wcampbell0x2a commented 10 months ago

Should be closed with https://github.com/sharksforarms/deku/pull/416