Small documentation updates on text
This commit is contained in:
parent
fadc47ce46
commit
fdaf81371c
2 changed files with 14 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
|||
//! interface over different types of diffing algorithms. It's based on the
|
||||
//! the diff algorithm implementations of [pijul](https://pijul.org/).
|
||||
//!
|
||||
//! The crate is split into two levels:
|
||||
//! The crate is split into two modules:
|
||||
//!
|
||||
//! * [`algorithms`]: This implements the different types of diffing algorithms.
|
||||
//! It provides both low level access to the algorithms with the minimal
|
||||
|
|
|
|||
13
src/text.rs
13
src/text.rs
|
|
@ -34,6 +34,19 @@
|
|||
//! }
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
//! ## Ops vs Changes
|
||||
//!
|
||||
//! Because very commonly two compared sequences will largely match this module
|
||||
//! splits it's functionality into two layers. The first is inherited from the
|
||||
//! general [`algorithms`](crate::algorithms) module: changes are encoded as
|
||||
//! [diff operations](crate::algorithms::DiffOp). These are ranges of the
|
||||
//! differences by index in the source sequence. Because this can be cumbersome
|
||||
//! to work with a separate method [`TextDiff::iter_changes`] is provided which
|
||||
//! expands all the changes on an item by item level encoded in an operation.
|
||||
//!
|
||||
//! Because the [`TextDiff::grouped_ops`] method can isolate clusters of changes
|
||||
//! this even works for very long files if paired with this method.
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
use std::io;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue