Skip to main content

diff_text

Function diff_text 

Source
pub fn diff_text(expected: &str, actual: &str) -> String
Expand description

Compute a simple line-by-line diff between two text strings.

Returns a human-readable string where:

  • Lines prefixed with are identical in both.
  • Lines prefixed with - appear only in expected.
  • Lines prefixed with + appear only in actual.

Returns an empty string when the inputs are identical.