@@ -9,21 +9,20 @@ pub use imara_diff::*;
99///
1010/// This module provides access to the v0.2 API of imara-diff, which includes
1111/// support for Git's slider heuristics to produce more intuitive diffs.
12- pub mod v0_2 {
13- pub use imara_diff_v0_2:: * ;
14- }
12+ #[ cfg( feature = "blob-experimental" ) ]
13+ pub use imara_diff_v2 as v2;
1514
1615/// Compute a diff with Git's slider heuristics to produce more intuitive diffs.
1716///
18- /// This function uses `imara-diff` v0.2 which provides the [`v0_2 ::Diff`] structure
17+ /// This function uses `imara-diff` v0.2 which provides the [`v2 ::Diff`] structure
1918/// that supports postprocessing with slider heuristics. The slider heuristics move
2019/// diff hunks to more intuitive locations based on indentation and other factors,
2120/// resulting in diffs that are more readable and match Git's output more closely.
2221///
2322/// # Examples
2423///
2524/// ```
26- /// use gix_diff::blob::{diff_with_slider_heuristics, v0_2 ::{Algorithm, InternedInput}};
25+ /// use gix_diff::blob::{diff_with_slider_heuristics, v2 ::{Algorithm, InternedInput}};
2726///
2827/// let before = "fn foo() {\n let x = 1;\n}\n";
2928/// let after = "fn foo() {\n let x = 2;\n}\n";
@@ -35,11 +34,9 @@ pub mod v0_2 {
3534/// assert_eq!(diff.count_removals(), 1);
3635/// assert_eq!(diff.count_additions(), 1);
3736/// ```
38- pub fn diff_with_slider_heuristics < T : AsRef < [ u8 ] > > (
39- algorithm : v0_2:: Algorithm ,
40- input : & v0_2:: InternedInput < T > ,
41- ) -> v0_2:: Diff {
42- let mut diff = v0_2:: Diff :: compute ( algorithm, input) ;
37+ #[ cfg( feature = "blob-experimental" ) ]
38+ pub fn diff_with_slider_heuristics < T : AsRef < [ u8 ] > > ( algorithm : v2:: Algorithm , input : & v2:: InternedInput < T > ) -> v2:: Diff {
39+ let mut diff = v2:: Diff :: compute ( algorithm, input) ;
4340 diff. postprocess_lines ( input) ;
4441 diff
4542}
0 commit comments