Skip to main content

diff_strings_no_color

Function diff_strings_no_color 

Source
pub fn diff_strings_no_color(left: &str, right: &str) -> String
Expand description

Returns a formatted line-by-line diff of two strings without ANSI color codes.

This always produces plain text output regardless of the NO_COLOR setting.

ยงExamples

use philiprehberger_diff_assert::diff_strings_no_color;

let result = diff_strings_no_color("a\nb\nc", "a\nx\nc");
assert_eq!(result, "  a\n- b\n+ x\n  c");