Skip to content

Commit

Permalink
doc(inline/iter_strings_lossy): describe different behaviors (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
wongjiahau committed Oct 12, 2023
1 parent 47f4625 commit 2b31f65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/text/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ impl<'s, T: DiffableStr + ?Sized> InlineChange<'s, T> {
///
/// Each item is a tuple in the form `(emphasized, value)` where `emphasized`
/// is true if it should be highlighted as an inline diff.
///
/// By default, words are split by whitespace, which results in coarser diff.
/// For example: `"f(x) y"` is tokenized as `["f(x)", "y"]`.
///
/// If you want it to be tokenized instead as `["f(", "x", ")"]`,
/// you should enable the `"unicode"` flag.
pub fn iter_strings_lossy(&self) -> impl Iterator<Item = (bool, Cow<'_, str>)> {
self.values()
.iter()
Expand Down

0 comments on commit 2b31f65

Please sign in to comment.