mitsuhiko / similar

A high level diffing library for rust based on diffs
https://insta.rs/similar
Apache License 2.0
949 stars 31 forks source link

Crash to_string method #38

Closed sv-91 closed 2 years ago

sv-91 commented 2 years ago

There is another example of crash

    let fst = "\ne\n\n\n\n\n\u{2}\n\n\n\n\n\n\n\u{2}\n\n\u{2}\n\n\n\nA\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
    let snd = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n*\0\n\0\n\n\n\n\n\0";

    let mut config = similar::TextDiffConfig::default();
    let diff = config.diff_lines(fst, snd);
    let mut output = diff.unified_diff();
    let result = output.to_string();
    println!("Result:\n{}", result);

And pleas, enable content_radius == 0 back

mitsuhiko commented 2 years ago

Cannot reproduce on master.