Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add impl Encode for [T], where T: Encode
Since Encode takes a reference, this allows us to encode &[T] directly using this implementation. The encoding scheme is the same as for Vec<T>. This also makes the implementation for &[u8] superfluous, since we get an implementation for [u8] by virtue of u8 implementing encode. This also gives us free implementations for &[u16], &[u32], etc. which is quite useful. Nonetheless, we keep the implementation for &[u8] around, because the implementation can directly write a large number of bytes, which can be more efficient than the generic implementation.
- Loading branch information