ayrat555 / frankenstein

Telegram bot API client for Rust
Do What The F*ck You Want To Public License
268 stars 28 forks source link

refactor: generalize serde logic into macro #218

Closed EdJoPaTo closed 1 month ago

EdJoPaTo commented 1 month ago

This combines all the serde and builder settings for the API structs into a single macro. serde_with::skip_serializing_none allows removing all the #[serde(skip_serializing_if = "Option::is_none")].

Doing something similar for the enums results in more lines before, so I just cleaned them up to use the same order of derives.

Nothing of this PR should be breaking.

EdJoPaTo commented 1 month ago

BTW @Veetaha thanks for the inspiration on this one!