Skip to content

Refactor to make "special" type machinery more reusable #479

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

Merged
merged 1 commit into from
Sep 11, 2018

Conversation

srijs
Copy link
Contributor

@srijs srijs commented Sep 11, 2018

In preparation for #355, this is a small refactoring to make the machinery for "special" types (such as the arbitrary precision numbers) more reusable.

The problem with the existing implementation is that it introduces alternative method implementations in a few places, which means that with every additional special type the number of methods that need to be changed or introduced grows.

This refactor moves to a more extensible structure where new special types simply require additional match branches.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay dtolnay merged commit d461263 into serde-rs:master Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants