Using a Request trait with a type alias Response instead of two generic types#5
Open
stackinspector wants to merge 2 commits intooguzbilgener:masterfrom
Open
Using a Request trait with a type alias Response instead of two generic types#5stackinspector wants to merge 2 commits intooguzbilgener:masterfrom
Request trait with a type alias Response instead of two generic types#5stackinspector wants to merge 2 commits intooguzbilgener:masterfrom
Conversation
Author
|
The previous error has been solved and I finished adjusting tests. |
Author
|
Since I've been doing too much refactoring since then, I've created a new crate. if you think this PR doesn't fit your idea, it's time to close it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note: This may be a sufficiently breaking change that it may be better to create another branch of this library and maintain it independently myself, rather than merging the changes into the current state of the library. The main purpose of this PR is discussion.
By using a
Requesttrait with a type aliasResponseinstead of two generic types, this library will be easier to use. In the future it could also be considered to allow transfering any type that implementsRequestin the channel by dynamic dispatching or something else. This would be more convenient when you need to pass values of multiple types, avoiding writing an enum and a lot ofmatchboilerplate code.Now I just finished the basic replacement and the current version does not compile through, with a kind of error that I can not understand and solve:
I found a similar case on Stack Overflow, but it doesn't seem to help me understand how to solve the current error.