File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 5
5
//! describes the difference between two non-`Clone` iterators `I` and `J` after breaking ASAP from
6
6
//! a lock-step comparison.
7
7
8
+ use std:: fmt;
9
+
8
10
use crate :: free:: put_back;
9
11
use crate :: structs:: PutBack ;
10
12
26
28
Longer ( usize , PutBack < J > ) ,
27
29
}
28
30
31
+ impl < I , J > fmt:: Debug for Diff < I , J >
32
+ where
33
+ I : Iterator ,
34
+ J : Iterator ,
35
+ PutBack < I > : fmt:: Debug ,
36
+ PutBack < J > : fmt:: Debug ,
37
+ {
38
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
39
+ match self {
40
+ Self :: FirstMismatch ( idx, i, j) => f
41
+ . debug_tuple ( "FirstMismatch" )
42
+ . field ( idx)
43
+ . field ( i)
44
+ . field ( j)
45
+ . finish ( ) ,
46
+ Self :: Shorter ( idx, i) => f. debug_tuple ( "Shorter" ) . field ( idx) . field ( i) . finish ( ) ,
47
+ Self :: Longer ( idx, j) => f. debug_tuple ( "Longer" ) . field ( idx) . field ( j) . finish ( ) ,
48
+ }
49
+ }
50
+ }
51
+
29
52
/// Compares every element yielded by both `i` and `j` with the given function in lock-step and
30
53
/// returns a [`Diff`] which describes how `j` differs from `i`.
31
54
///
You can’t perform that action at this time.
0 commit comments