pub struct FixEdit {
pub span: Span,
pub replacement: String,
}Expand description
A machine-applicable text replacement for autofixing diagnostics.
Fields§
§span: SpanThe source span to replace.
replacement: StringThe replacement text (empty string = deletion).
Implementations§
Source§impl FixEdit
impl FixEdit
Sourcepub fn dedupe_overlapping(edits: &[FixEdit]) -> Vec<FixEdit>
pub fn dedupe_overlapping(edits: &[FixEdit]) -> Vec<FixEdit>
Sort edits right-to-left by start offset and drop any that overlap an
already-accepted edit, returning the survivors in descending-start
order — ready to splice right-to-left without invalidating earlier
offsets. This is the single source of truth for the “apply all fixes,
drop conflicts” policy that harn fmt, harn lint --fix, and the LSP
on-save fixer must agree on byte-for-byte.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FixEdit
impl RefUnwindSafe for FixEdit
impl Send for FixEdit
impl Sync for FixEdit
impl Unpin for FixEdit
impl UnsafeUnpin for FixEdit
impl UnwindSafe for FixEdit
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