File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1713,6 +1713,15 @@ pub struct IntoIter<T> {
1713
1713
end : * const T ,
1714
1714
}
1715
1715
1716
+ #[ stable( feature = "vec_intoiter_debug" , since = "" ) ]
1717
+ impl < T : fmt:: Debug > fmt:: Debug for IntoIter < T > {
1718
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1719
+ f. debug_tuple ( "IntoIter" )
1720
+ . field ( & self . as_slice ( ) )
1721
+ . finish ( )
1722
+ }
1723
+ }
1724
+
1716
1725
impl < T > IntoIter < T > {
1717
1726
/// Returns the remaining items of this iterator as a slice.
1718
1727
///
Original file line number Diff line number Diff line change @@ -501,6 +501,14 @@ fn test_into_iter_as_mut_slice() {
501
501
assert_eq ! ( into_iter. as_slice( ) , & [ 'y' , 'c' ] ) ;
502
502
}
503
503
504
+ #[ test]
505
+ fn test_into_iter_debug ( ) {
506
+ let vec = vec ! [ 'a' , 'b' , 'c' ] ;
507
+ let into_iter = vec. into_iter ( ) ;
508
+ let debug = format ! ( "{:?}" , into_iter) ;
509
+ assert_eq ! ( debug, "IntoIter(['a', 'b', 'c'])" ) ;
510
+ }
511
+
504
512
#[ test]
505
513
fn test_into_iter_count ( ) {
506
514
assert_eq ! ( vec![ 1 , 2 , 3 ] . into_iter( ) . count( ) , 3 ) ;
You can’t perform that action at this time.
0 commit comments