-
Notifications
You must be signed in to change notification settings - Fork 54
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
use a boxed trait for the Repository #52
base: master
Are you sure you want to change the base?
Conversation
this should be rebased once(/if) #50 is merged |
under this scheme, both the CLI and GIT2 strategies should be feature-gated (though can be included by default) |
Codecov Report
@@ Coverage Diff @@
## master #52 +/- ##
=========================================
+ Coverage 0.00% 0.25% +0.25%
=========================================
Files 50 47 -3
Lines 1988 1963 -25
=========================================
+ Hits 0 5 +5
+ Misses 1988 1958 -30
Continue to review full report at Codecov.
|
Initially, I would have said that there isn't much to be gained from using boxed dynamic dispatch vs an enum, but with the upcoming library-split of Alexandrie, I think dynamic dispatch makes more sense. One thing, though, is that we may have the same kind of naming problem with |
i'll take another look at the naming conventions. I agree with you there's some work to do there. I cannot for the life of me remember in which order these pull requests should be merged (if they're merged) |
depends on #50
this is what it would look like if the index enum was eliminated all-together (i've replaced it with a boxed trait).
The advantage of this is you can use any object capable of managing a git repo, not just the implementations defined in this crate.
i'd be interested to get your thoughts on this @Hirevo?
there's another alternative, which is to make the Index generic over the repository type, rather than boxing the trait. The calling code would then probably need to box the Index to avoid specifying a concrete type.