Make highlight_line()
and parse_line()
return Result
#426
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.
And also adapt most other related code to this change, and add a
Result
to anotherhtml
function.In
examples/
andbenches/
I simply do .unwrap()In tests I do
.expect("#[cfg(test)]")
to make reviewing the diff easyIn deprecated methods I simply do .expect("helpful hint about new method")
In
uses_backrefs = uses_backrefs || proto_ids.iter().any(|id|syntax_set.get_context(id).unwrap().uses_backrefs);
I do an.unwrap()
because?
does not work inside of.any()
. But that can be fixed later if necessary without semver breakage.To keep the scope of the PR manageable I do
.unwrap()
inContextReference::resolve()
andimpl<'a> Iterator for MatchIter<'a>
to not have to propagate an error further. That will be done in a follow-up PR.The impact on the public API is as follows:
Performance-wise I can not detect any significant difference on my low-end desktop
Detailed benchmark numbers with master as baseline
Finally a note on chaining many PRs together: I do that sometimes, but normally I have not written or at least not polished the code that comes next. Stacking many PRs on top of each other risks creating quite gnarly conflicts in case other PRs are merged in between or if you have code review comments on the first PR in a set, that other PRs depend on. So to be as efficient as possible in terms of man-hours (rather than calendar-hours) I prefer to take one step at a time in the right direction.
So if it is OK with you to keep our current pace, that is very much OK with me too.
This is one step towards resolving #98