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
{{ message }}
This repository was archived by the owner on Dec 1, 2023. It is now read-only.
What caused the current number of implementations?
I want to serialize [u8, 64], now for this I need to create my own type and to write implementation for it, there is no way to create trait implementation for non-foreing type (rust-lang/rfcs#1023).
The text was updated successfully, but these errors were encountered:
The number is of course arbitrary, but libstd itself is using 0–32 inclusive as well. Past that range, arrays don't impl PartialEq or AsRef etc, a range of traits. So there's a certain consistency.
In Serde we plan to support this by generating smarter code rather than by extending the array impls to bigger sizes. serde-rs/serde#631
#[derive(Serialize)]structS{array:[u8;64],}
Here the generated code should see that the array is bigger than our biggest array impl so it should generate a loop to serialize the array rather than trying to delegate to [u8; 64]'s implementation of Serialize (which doesn't exist).
I'm going to close this now that this crate is deprecated in favor of serde. We're discontinuing feature development in rustc-serialize but will still continue to merge bug fixes if they arise.
As I can see it is possible to simply implement this by adding needed numbers to
(https://github.com/rust-lang-nursery/rustc-serialize/blob/master/src/serialize.rs#L1306)
What caused the current number of implementations?
I want to serialize [u8, 64], now for this I need to create my own type and to write implementation for it, there is no way to create trait implementation for non-foreing type (rust-lang/rfcs#1023).
The text was updated successfully, but these errors were encountered: