use [patch] sections to specify serde_json dependency #20
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.
The repo currently uses explicit git dependencies for
serde_json
(for example here)This has to two disadvantages:
=
-version constraint in aCargo.toml
and can cause version collisions if dependents use a different version ofserde_json
(no interaction between both versions is then possible).serde_json
in transitive dependencies of this crate, and hence makes it so this crate uses multiple versions ofserde_json
(see the diffs in theCargo.lock
files for this PR)The one small advantage is that it puts no burden on users of this crate to patch
serde_json
for this crate specifically, but this is easily outweighed by the disadvantages mentioned above.Better is to use a
[patch]
section, so that dependencies are patched transitively (if parts of this repo are used and built stand-alone) but can still be re-patched/overridden by its clients. This PR implements this change.