From e14b26502b8018c1bb9178142f11de89149ab805 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 31 Jan 2021 22:16:45 +0100 Subject: [PATCH] Make InlineChange consistent with Change for missing_newline --- examples/terminal-inline.rs | 2 +- src/text/inline.rs | 2 +- src/text/mod.rs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/terminal-inline.rs b/examples/terminal-inline.rs index e047259..5bfbd27 100644 --- a/examples/terminal-inline.rs +++ b/examples/terminal-inline.rs @@ -51,7 +51,7 @@ fn main() { print!("{}", s.apply_to(value)); } } - if change.is_missing_newline() { + if change.missing_newline() { println!(); } } diff --git a/src/text/inline.rs b/src/text/inline.rs index 0270e76..3376278 100644 --- a/src/text/inline.rs +++ b/src/text/inline.rs @@ -66,7 +66,7 @@ impl<'s> InlineChange<'s> { /// Returns `true` if this change needs to be followed up by a /// missing newline. - pub fn is_missing_newline(&self) -> bool { + pub fn missing_newline(&self) -> bool { self.missing_newline } } diff --git a/src/text/mod.rs b/src/text/mod.rs index d361a37..54ebfbd 100644 --- a/src/text/mod.rs +++ b/src/text/mod.rs @@ -155,7 +155,8 @@ impl TextDiffConfig { /// Creates a diff of unicode words. /// /// This splits the text into words according to unicode rules. This is - /// generally recommended over [`diff_words`] but requires a dependency. + /// generally recommended over [`TextDiffConfig::diff_words`] but + /// requires a dependency. /// /// This requires the `unicode` feature. #[cfg(feature = "unicode")] @@ -513,7 +514,7 @@ impl<'old, 'new, 'bufs> TextDiff<'old, 'new, 'bufs> { /// Iterates over the changes the op expands to with inline emphasis. /// - /// This is very similar to [`iter_changes`] but it performs a second + /// This is very similar to [`TextDiff::iter_changes`] but it performs a second /// level diff on adjacent line replacements. The exact behavior of /// this function with regards to how it detects those inline changes /// is currently not defined and will likely change over time.