construction/
construction.rs1use line_diff::{compare_lines, Config};
2
3use std::error;
4use std::path::PathBuf;
5
6type Result<T> = std::result::Result<T, Box<dyn error::Error>>;
7
8fn main() -> Result<()> {
9 println!("Example with two lines");
10 let config = Config::from_lines(false, false, vec![' '], "Hello World", "hello World");
11 println!("{:?}", config);
12 compare_lines(config)?;
13
14 println!("Example with using a single file containing two lines");
15 let config = Config::from_file(
16 false,
17 false,
18 vec![' '],
19 PathBuf::from("examples/twolines.txt"),
20 );
21 println!("{:?}", config);
22 compare_lines(config)
23}