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

Remove unnecessary manual model (de)serializers #1364

Open
4 of 6 tasks
zeylahellyer opened this issue Dec 26, 2021 · 1 comment
Open
4 of 6 tasks

Remove unnecessary manual model (de)serializers #1364

zeylahellyer opened this issue Dec 26, 2021 · 1 comment
Labels
c-model Affects the model crate t-refactor Refactors APIs or code.
Milestone

Comments

@zeylahellyer
Copy link
Member

zeylahellyer commented Dec 26, 2021

There are probably some types that we manually implement serde::Deserialize and serde::Serialize on that we can defer to proc macro derives.

@zeylahellyer zeylahellyer added this to the Model Rework milestone Dec 26, 2021
@zeylahellyer zeylahellyer moved this to Todo in Go 1.0 Dec 26, 2021
@zeylahellyer zeylahellyer added c-model Affects the model crate t-refactor Refactors APIs or code. labels Dec 26, 2021
@vilgotf
Copy link
Member

vilgotf commented Oct 13, 2022

Most manual deserializers can be removed by not inserting a guild_id into types (which there's already internal support for, see, for example, Member vs MemberIntermediary), but otherwise it's impossible without additional derive APIs from serde.

zeylahellyer added a commit that referenced this issue Jan 25, 2023
Simplify the (de)serialization of
`gateway::presence::activity_button::ActivityButtonText`. We can remove
the custom Deserialize and Serialize implementations by taking advantage
of the fact that it has only one field, and instead using
`#[serde(transparent)]`.

Part of #1364.
zeylahellyer added a commit that referenced this issue Jan 28, 2023
Simplify the (de)serialization of
`gateway::presence::activity_button::ActivityButtonText`. We can remove
the custom Deserialize and Serialize implementations by taking advantage
of the fact that it has only one field, and instead using
`#[serde(transparent)]`.

Part of #1364.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-model Affects the model crate t-refactor Refactors APIs or code.
Projects
Status: Todo
Development

No branches or pull requests

2 participants