Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace Into<Self> bound with standalone function #14504

Closed
mattsse opened this issue Feb 14, 2025 · 3 comments · Fixed by #14512
Closed

replace Into<Self> bound with standalone function #14504

mattsse opened this issue Feb 14, 2025 · 3 comments · Fixed by #14512
Assignees
Labels
A-sdk Related to reth's use as a library C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Milestone

Comments

@mattsse
Copy link
Collaborator

mattsse commented Feb 14, 2025

Describe the feature

due to Into we can't use &Self as the compat type

/// Serde representation of the type for bincode serialization.
///
/// This type defines the bincode compatible serde format for the type.
type BincodeRepr<'a>: Debug + Serialize + DeserializeOwned + Into<Self>;
/// Convert this type into its bincode representation
fn as_repr(&self) -> Self::BincodeRepr<'_>;

similar limitation why we added as_repr, now we need to introduce

from_repr

and replace the Into bound with that, this way we can use &Self as the compat

TODO

  • replace Into with from_repr(Self::BincodeRepr<'_>) -> Self
  • update all impls

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Feb 14, 2025
@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started A-sdk Related to reth's use as a library and removed S-needs-triage This issue needs to be labelled labels Feb 14, 2025
@caglaryucekaya
Copy link
Contributor

Hey, I'd like to work on this

@mattsse
Copy link
Collaborator Author

mattsse commented Feb 14, 2025

assigned, ty

btw haven't forgotten about #13621 just need to run some checks to wrap it up

@mattsse mattsse added this to the release 1.2.1 milestone Feb 14, 2025
@caglaryucekaya
Copy link
Contributor

np, yeah that probably needs some time to check and review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdk Related to reth's use as a library C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants