doc(inline/iter_strings_lossy): describe different behaviors (#52)
This commit is contained in:
parent
47f46257d4
commit
2b31f65445
1 changed files with 6 additions and 0 deletions
|
|
@ -147,6 +147,12 @@ impl<'s, T: DiffableStr + ?Sized> InlineChange<'s, T> {
|
||||||
///
|
///
|
||||||
/// Each item is a tuple in the form `(emphasized, value)` where `emphasized`
|
/// Each item is a tuple in the form `(emphasized, value)` where `emphasized`
|
||||||
/// is true if it should be highlighted as an inline diff.
|
/// 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>)> {
|
pub fn iter_strings_lossy(&self) -> impl Iterator<Item = (bool, Cow<'_, str>)> {
|
||||||
self.values()
|
self.values()
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue