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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement as an extension trait #1

merged 7 commits into from Feb 23, 2019


Copy link

@sunjay sunjay commented Feb 23, 2019

Hello! Thanks for making such a great crate! This is a great idea and something I actually want to use for a project I'm working on right now. I am the person who left a comment on your Reddit thread.

I was very curious to see if this could work, so I went ahead and tried it out. It turns out that not only is it possible to model this with a trait, it also removes the need for the custom types and the use of the Try trait. No more nightly feature and everything is done with just tuples and Result types!

Reviewing this PR

To review this PR, I suggest you look at what I did commit by commit. The full diff is probably a bit big and hard to read. The commits show what I did step-by-step and so it will probably be a bit easier to understand if you read them in order.


  1. First, I just reimplemented everything with an extension trait (same exact functionality as before)
  2. Using a macro, I added implementations for up to 27 tuple variants (letters in the alphabet + 1)
  3. I updated the README example to the new syntax, fixed some typos, etc.
  4. Added complete documentation for both the crate itself and the trait (see below for screenshots)
  5. Bumped the version from 0.2 to 0.3 because this is definitely a breaking change

You can click on the "Commits" tab and then click on each commit to see each step as described.


All the tests still pass. I updated them to use the new syntax. You should probably add Travis CI so your tests will run automatically for PRs. :)


I added documentation. 馃帀 Here are some screenshots:


screenshot from 2019-02-23 12-27-25

screenshot from 2019-02-23 12-27-38

@JoshMcguigan JoshMcguigan merged commit d39b328 into JoshMcguigan:master Feb 23, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Copy link

@JoshMcguigan JoshMcguigan commented Feb 23, 2019

Thanks again for this excellent PR!

@sunjay sunjay deleted the sunjay:extension-trait branch Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants