paritytech / paritytech/parity-scale-codec
EncodeLike<Self> should be implemented for all Encode types
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 287
- Forks
- 103
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 1
Description
in this context:
fn foo<T: Encode>(t: T) {
put<T, _>(t);
}
fn put<T, EncodeLikeT: EncodeLike<T>>(like_t: EncodeLikeT) {}
this doesn't work because T doesn't implement EncodeLike, only Encode.
A way to solve this would be to have the following traits:
pub trait Encode: EncodeImpl + EncodeLike {}
impl<S: EncodeImpl + EncodeLike> Encode for S {}
and rename Encode -> EncodeImpl
but this is a breaking change. Actually maybe we may be able to change it without breaking substrate by first releasing new minor of version of parity-common/primitive-types with EncodeLike impls
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Encode, EncodeImpl, and EncodeLike trait definitions and their implementations in this Rust crate. Review compatibility with parity-common/primitive-types and the existing test suite; done means a decided, non-breaking path for making Encode values usable where EncodeLike is required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100