@@ -11,26 +11,26 @@ pub struct OrderedDocument {
11
11
12
12
/// An iterator over OrderedDocument entries.
13
13
#[ derive( Clone ) ]
14
- pub struct OrderedDocumentIterator {
14
+ pub struct OrderedDocumentIntoIterator {
15
15
ordered_document : OrderedDocument ,
16
16
index : usize ,
17
17
}
18
18
19
19
/// An owning iterator over OrderedDocument entries.
20
20
#[ derive( Clone ) ]
21
- pub struct OrderedDocumentIntoIterator < ' a > {
21
+ pub struct OrderedDocumentIterator < ' a > {
22
22
ordered_document : & ' a OrderedDocument ,
23
23
index : usize ,
24
24
}
25
25
26
26
/// An iterator over an OrderedDocument's keys.
27
27
pub struct Keys < ' a > {
28
- inner : Map < OrderedDocumentIntoIterator < ' a > , fn ( ( & ' a String , & ' a Bson ) ) -> & ' a String >
28
+ inner : Map < OrderedDocumentIterator < ' a > , fn ( ( & ' a String , & ' a Bson ) ) -> & ' a String >
29
29
}
30
30
31
31
/// An iterator over an OrderedDocument's values.
32
32
pub struct Values < ' a > {
33
- inner : Map < OrderedDocumentIntoIterator < ' a > , fn ( ( & ' a String , & ' a Bson ) ) -> & ' a Bson >
33
+ inner : Map < OrderedDocumentIterator < ' a > , fn ( ( & ' a String , & ' a Bson ) ) -> & ' a Bson >
34
34
}
35
35
36
36
impl < ' a > Clone for Keys < ' a > {
@@ -54,19 +54,19 @@ impl<'a> Iterator for Values<'a> {
54
54
55
55
impl IntoIterator for OrderedDocument {
56
56
type Item = ( String , Bson ) ;
57
- type IntoIter = OrderedDocumentIterator ;
57
+ type IntoIter = OrderedDocumentIntoIterator ;
58
58
59
59
fn into_iter ( self ) -> Self :: IntoIter {
60
- OrderedDocumentIterator { ordered_document : self , index : 0 }
60
+ OrderedDocumentIntoIterator { ordered_document : self , index : 0 }
61
61
}
62
62
}
63
63
64
64
impl < ' a > IntoIterator for & ' a OrderedDocument {
65
65
type Item = ( & ' a String , & ' a Bson ) ;
66
- type IntoIter = OrderedDocumentIntoIterator < ' a > ;
66
+ type IntoIter = OrderedDocumentIterator < ' a > ;
67
67
68
68
fn into_iter ( self ) -> Self :: IntoIter {
69
- OrderedDocumentIntoIterator { ordered_document : self , index : 0 }
69
+ OrderedDocumentIterator { ordered_document : self , index : 0 }
70
70
}
71
71
}
72
72
@@ -80,7 +80,7 @@ impl FromIterator<(String, Bson)> for OrderedDocument {
80
80
}
81
81
}
82
82
83
- impl < ' a > Iterator for OrderedDocumentIterator {
83
+ impl < ' a > Iterator for OrderedDocumentIntoIterator {
84
84
type Item = ( String , Bson ) ;
85
85
fn next ( & mut self ) -> Option < ( String , Bson ) > {
86
86
if self . ordered_document . keys . len ( ) <= self . index {
@@ -94,7 +94,7 @@ impl<'a> Iterator for OrderedDocumentIterator {
94
94
}
95
95
}
96
96
97
- impl < ' a > Iterator for OrderedDocumentIntoIterator < ' a > {
97
+ impl < ' a > Iterator for OrderedDocumentIterator < ' a > {
98
98
type Item = ( & ' a String , & ' a Bson ) ;
99
99
fn next ( & mut self ) -> Option < ( & ' a String , & ' a Bson ) > {
100
100
if self . ordered_document . keys . len ( ) <= self . index {
@@ -118,7 +118,7 @@ impl OrderedDocument {
118
118
}
119
119
120
120
/// Gets an iterator over the entries of the map.
121
- pub fn iter < ' a > ( & ' a self ) -> OrderedDocumentIntoIterator < ' a > {
121
+ pub fn iter < ' a > ( & ' a self ) -> OrderedDocumentIterator < ' a > {
122
122
self . into_iter ( )
123
123
}
124
124
0 commit comments