pub struct NearestMiss {
pub line: usize,
pub first_diverging_line: usize,
pub expected: String,
pub found: String,
pub block_len: usize,
}Expand description
The best partial alignment of a block that did not match.
Fields§
§line: usize1-based source line where the best candidate alignment starts.
first_diverging_line: usize1-based index into the block of the first diverging line.
expected: StringThe block line that was expected at the divergence.
found: StringThe source line actually found there (empty past end of file).
block_len: usizeTotal number of lines in the find block (for self-diagnosing output).
Implementations§
Source§impl NearestMiss
impl NearestMiss
Sourcepub fn blank_line_hint(&self) -> Option<String>
pub fn blank_line_hint(&self) -> Option<String>
A diagnostic note when the divergence is likely a stray blank line in
the find payload — the expected block line is empty, which an editor’s
trailing newline (or a hand-pasted blank line) commonly produces — else
None. Block anchors taken from file: payloads have their trailing
blank lines trimmed, so this remains useful mainly for inline/text:
payloads and interior empty lines.
Trait Implementations§
Source§impl Clone for NearestMiss
impl Clone for NearestMiss
Source§fn clone(&self) -> NearestMiss
fn clone(&self) -> NearestMiss
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NearestMiss
impl Debug for NearestMiss
impl Eq for NearestMiss
Source§impl PartialEq for NearestMiss
impl PartialEq for NearestMiss
Source§fn eq(&self, other: &NearestMiss) -> bool
fn eq(&self, other: &NearestMiss) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for NearestMiss
Auto Trait Implementations§
impl Freeze for NearestMiss
impl RefUnwindSafe for NearestMiss
impl Send for NearestMiss
impl Sync for NearestMiss
impl Unpin for NearestMiss
impl UnsafeUnpin for NearestMiss
impl UnwindSafe for NearestMiss
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