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.
These changes don't modify the current functionality but, as mentioned in the commit message descriptions, it logically makes more sense to use
end
instead ofstart
, sincefind_unwrap_start
could return astart != end
, and in those cases we'd like to start looking for headers fromend+1
instead of fromstart+1
. Furthermore, if the headers don't start at the first line,extract_headers
will fail, so another argument to useend + 1
.Do you think I should add some "artificially" created tests for these updates? Like mentioned in the comments, some of them would look like:
and
notice that in both cases the header line for reply/forward takes two lines so this makes
end != start
as returned byfind_unwrap_start
, but that shouldn't really happen in real emails since those look poorly formatted and email clients would probably fix this?