pub enum ConflictReason {
EditedInsideRange,
AnchorDeleted,
}Expand description
Why a proposal hunk could not be carried forward onto the current buffer.
Each variant names a case from ADR-0006 §4 so the review UI can say what happened (“you edited inside this change”) rather than reporting a generic failure. That distinction is most of the difference between a reviewable tool and a mysterious one.
Variants§
EditedInsideRange
ADR-0006 §4 case 2 — the human typed inside text this hunk wanted to replace. Applying would destroy their edit without ever showing it to them.
AnchorDeleted
ADR-0006 §4 case 4 — the text this hunk was anchored to is partly gone, so where it belongs is guesswork.
Implementations§
Source§impl ConflictReason
impl ConflictReason
Sourcepub fn from_effect(effect: RangeEffect) -> Option<Self>
pub fn from_effect(effect: RangeEffect) -> Option<Self>
The conflict implied by what an applied change did to a hunk’s range, or None
if the hunk can still be carried forward.
This is ADR-0006 §4’s table as code: ChangeSet::touches reports what happened,
and this decides what it means for review. Case 5 (the human already made the same
change) is deliberately not here — it is a content check that runs before this
one, because a satisfied hunk looks exactly like a deleted anchor from here.
Trait Implementations§
Source§impl Clone for ConflictReason
impl Clone for ConflictReason
Source§fn clone(&self) -> ConflictReason
fn clone(&self) -> ConflictReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more