MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / convert_line_change

Method convert_line_change

atomic-core/src/diff/semantic_to_crdt.rs:344–376  ·  view source on GitHub ↗

Convert a single LineChange to LineOps.

(
        &mut self,
        change: &LineChange<'a>,
    )

Source from the content-addressed store, hash-verified

342
343 /// Convert a single LineChange to LineOps.
344 fn convert_line_change<'a>(
345 &mut self,
346 change: &LineChange<'a>,
347 ) -> ConversionResult<Vec<LineOps>> {
348 match change {
349 LineChange::Added {
350 line_num,
351 line,
352 tokens,
353 ..
354 } => self.convert_added_line(*line_num, line, tokens),
355 LineChange::Deleted {
356 line_num,
357 line,
358 tokens,
359 ..
360 } => self.convert_deleted_line(*line_num, line, tokens),
361 LineChange::Modified {
362 old_line_num,
363 new_line_num,
364 before,
365 after,
366 token_changes,
367 ..
368 } => self.convert_modified_line(
369 *old_line_num,
370 *new_line_num,
371 before,
372 after,
373 token_changes,
374 ),
375 }
376 }
377
378 /// Convert an added line to LineOps.
379 fn convert_added_line<'a>(

Callers 1

convert_diffMethod · 0.80

Calls 3

convert_added_lineMethod · 0.80
convert_deleted_lineMethod · 0.80
convert_modified_lineMethod · 0.80

Tested by

no test coverage detected