#[non_exhaustive]pub struct WhitespaceMode {
pub ignore_all_space: bool,
pub ignore_space_change: bool,
pub ignore_space_at_eol: bool,
pub ignore_blank_lines: bool,
}Expand description
Whitespace handling for line diffs (super::DiffOptions::whitespace).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ignore_all_space: bool-w / --ignore-all-space: drop every whitespace character when comparing lines.
ignore_space_change: bool-b / --ignore-space-change: collapse runs of whitespace to one space; trim trailing spaces.
ignore_space_at_eol: bool--ignore-space-at-eol: trim trailing whitespace before the line terminator.
ignore_blank_lines: bool--ignore-blank-lines: treat blank-line-only change records as ignorable (Git xch->ignore).
Implementations§
Source§impl WhitespaceMode
impl WhitespaceMode
Sourcepub fn ignore_all_space() -> Self
pub fn ignore_all_space() -> Self
-w / --ignore-all-space.
Sourcepub fn ignore_space_change() -> Self
pub fn ignore_space_change() -> Self
-b / --ignore-space-change.
Sourcepub fn ignore_blank_lines() -> Self
pub fn ignore_blank_lines() -> Self
--ignore-blank-lines.
Sourcepub fn normalizes_line_compare(self) -> bool
pub fn normalizes_line_compare(self) -> bool
Whether line text should be normalized before xdiff line hashing (-w, -b, --ignore-space-at-eol).
Sourcepub fn normalize_line_for_compare<'a>(&self, line: &'a str) -> Cow<'a, str>
pub fn normalize_line_for_compare<'a>(&self, line: &'a str) -> Cow<'a, str>
Normalize one line body (without its trailing \n) for line-interner comparison.
Trait Implementations§
Source§impl Clone for WhitespaceMode
impl Clone for WhitespaceMode
impl Copy for WhitespaceMode
Source§impl Debug for WhitespaceMode
impl Debug for WhitespaceMode
Source§impl Default for WhitespaceMode
impl Default for WhitespaceMode
impl Eq for WhitespaceMode
Source§impl Hash for WhitespaceMode
impl Hash for WhitespaceMode
Source§impl PartialEq for WhitespaceMode
impl PartialEq for WhitespaceMode
impl StructuralPartialEq for WhitespaceMode
Auto Trait Implementations§
impl Freeze for WhitespaceMode
impl RefUnwindSafe for WhitespaceMode
impl Send for WhitespaceMode
impl Sync for WhitespaceMode
impl Unpin for WhitespaceMode
impl UnsafeUnpin for WhitespaceMode
impl UnwindSafe for WhitespaceMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more