Support for custom default fuction with owned pattern #315
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix for #298
I finally got back to my hobby project where I need this so I got around to implement this feature/bug fix.
I've implemented the solution I described in that issue so I won't repeat it here again. If there are any open questions I'm happy to answer them or adjust this PR.
No unwrap_or does not work because it expects a
T
and the default we have is an Option. Either we use or and than unwrap or we can useunwrap_or(default.unwrap())
. I personally think thator.unwrap
is a bit nicer.PS: I know that the rust 1.59 tests are failing right now. "Syn" just published a new version "2.0.55" that requires rust 1.60.
However on my fork the 1.59 tests succeeded with the old syn version.
PPS: I know that are a lot of commits. The best solution is to just squash them I think but I am open to rebasing them into a few usefull commits if you prefer that. This is a rather large change after all.