line_diff 0.13.2

A tool to compare single lines by tokenizing them into chunks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use line_diff::{compare_lines, Config};

use std::error;

type Result<T> = std::result::Result<T, Box<dyn error::Error>>;

fn main() -> Result<()> {
    println!("Example without lowercase");
    let config = Config::from_lines(false, false, vec![' '], "Hello World", "Hello world");
    println!("{:?}", config);
    compare_lines(config)?;

    println!("Example with sorting");
    let config = Config::from_lines(false, true, vec![' '], "Hello World", "Hello world");
    println!("{:?}", config);
    compare_lines(config)
}