pub struct IndentHeuristic<IndentOfToken> { /* private fields */ }Available on crate feature
blob only.Expand description
A slider heuristic that uses indentation levels to determine the best hunk position.
This heuristic analyzes the indentation of lines surrounding potential hunk positions and chooses the position that results in the most intuitive diff for human readers. It’s particularly effective for code and other indented text.
Implementations§
Source§impl<IndentOfToken> IndentHeuristic<IndentOfToken>
impl<IndentOfToken> IndentHeuristic<IndentOfToken>
Sourcepub fn new(indent_of_token: IndentOfToken) -> IndentHeuristic<IndentOfToken>
pub fn new(indent_of_token: IndentOfToken) -> IndentHeuristic<IndentOfToken>
Creates a new IndentHeuristic with the given indentation function.
§Parameters
indent_of_token- A function that takes a token and returns its indentation level
Trait Implementations§
Source§impl<IndentOfToken> SliderHeuristic for IndentHeuristic<IndentOfToken>
impl<IndentOfToken> SliderHeuristic for IndentHeuristic<IndentOfToken>
Auto Trait Implementations§
impl<IndentOfToken> Freeze for IndentHeuristic<IndentOfToken>where
IndentOfToken: Freeze,
impl<IndentOfToken> RefUnwindSafe for IndentHeuristic<IndentOfToken>where
IndentOfToken: RefUnwindSafe,
impl<IndentOfToken> Send for IndentHeuristic<IndentOfToken>where
IndentOfToken: Send,
impl<IndentOfToken> Sync for IndentHeuristic<IndentOfToken>where
IndentOfToken: Sync,
impl<IndentOfToken> Unpin for IndentHeuristic<IndentOfToken>where
IndentOfToken: Unpin,
impl<IndentOfToken> UnsafeUnpin for IndentHeuristic<IndentOfToken>where
IndentOfToken: UnsafeUnpin,
impl<IndentOfToken> UnwindSafe for IndentHeuristic<IndentOfToken>where
IndentOfToken: UnwindSafe,
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