jamesmunns / postcard

A no_std + serde compatible message library for Rust
Apache License 2.0
929 stars 88 forks source link

postcard-schema: inconsistent schema names for `[T]` and `[T; N]` #182

Open max-heller opened 1 week ago

max-heller commented 1 week ago

Is there a reason for [T]'s schema name to be &[T] while [T; N]'s is [T; N] (no &)? It seems like it'd be more consistent to remove the &.

https://github.com/jamesmunns/postcard/blob/70111772ee231364daeac7cd11063352f19bc930/source/postcard-schema/src/impls/builtins_nostd.rs#L91-L102

jamesmunns commented 1 week ago

I think that's reasonable. The idea was to make it clear the former is a slice (e.g. with a len), whereas the latter is an array. I don't often use bare unsized slices, so I used &[T] out of habit.

That being said, [T] is probably more consistent.