-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document, test, and refactor prefix functions
There was a request that I document why the `contents.is_empty()` logic is present. I think it makes more logical sense to encode that information in the code, so I refactored to use a peekable iterator instead. Anyone who does not want to apply a prefix to an empty slice can do so via their custom function passed to `prefix_lines`. I added docs for the `prefix_first_rest_lines` to call out the edge case of calling with an empty slice.
- Loading branch information
Showing
1 changed file
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters