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
I had the need for [u8; 65] (64 byte signature + nonce) but had to rely on Vec<u8> for now since we currently only generate implementations for sizes 1-32.
The text was updated successfully, but these errors were encountered:
This is a similar problem to serde-rs/serde#1937 - serde implements Serialize for [T; 0] even when T doesn't implement Serialize, so I followed the same pattern with JsonSchema. Unfortunately, this makes it difficult to use const generics, because in the general case, [T; n] requires T: JsonSchema, which would then mean that [T; 0] would also require T: JsonSchema.
That would be a breaking change (which we can do in 1.0), and a divergence from how serde works, although I don't think it's unreasonable - after all, how often to people really generate a JSON schema for [T; 0] where T doesn't implement JsonSchema?
But out of interest, what's your use-case? As I understand it, you can't be using serde to serialize/deserialize that type because it doesn't use const generics?
1.51 stabilized support for const generics on arrays, that way array length can be supported.
I had the need for
[u8; 65]
(64 byte signature + nonce) but had to rely onVec<u8>
for now since we currently only generate implementations for sizes 1-32.The text was updated successfully, but these errors were encountered: