Add legacy-syntax
and syn-2
features
#22
Closed
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 PR does essentially two things:
legacy-syntax
and gates thetest
macro behind that featuresyn-2
feature to enabled use ofsyn
version 2gitoxide
brings in two copies ofsyn
, version 1 and version 2. Relying onmaybe-async
is the reason it needs version 1.maybe-async
cannot be easily converted to usesyn
version 2.maybe-async
'stest
macro usesasync
as a nested attribute name. However, Rust 2018 addedasync
as a keyword, and keywords cannot be used as attribute names. For this reason,syn
does not parse them. One could try to work around thesyn
limitation, but one could also make a case thatasync
should be changed to something else.Despite all this,
gitoxide
does not use thetest
macro.So, with the features described above,
gitodixde
can usemaybe-async
withdefault-features = false, features = ["syn-2"]
and not have to bring in syn version 1.I have not discussed this with the
gitoxide
maintainers. If you prefer, I could first get confirmation from them that they like this plan.Also, I realize this is out of the blue. Feel free to nit anything, or close this PR if you don't like the idea.