File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ impl<'a> Iterator for Keys<'a> {
40
40
41
41
impl < ' a > Iterator for Values < ' a > {
42
42
type Item = & ' a Bson ;
43
-
44
43
fn next ( & mut self ) -> Option < ( & ' a Bson ) > { self . inner . next ( ) }
45
44
}
46
45
@@ -84,7 +83,7 @@ impl<'a> Iterator for OrderedDocumentIntoIterator {
84
83
fn next ( & mut self ) -> Option < ( String , Bson ) > {
85
84
match self . vec_iter . next ( ) {
86
85
Some ( key) => {
87
- let val = self . document . get ( & key[ ..] ) . unwrap ( ) ;
86
+ let val = self . document . remove ( & key[ ..] ) . unwrap ( ) ;
88
87
Some ( ( key, val. to_owned ( ) ) )
89
88
} ,
90
89
None => None ,
@@ -96,7 +95,10 @@ impl<'a> Iterator for OrderedDocumentIterator<'a> {
96
95
type Item = ( & ' a String , & ' a Bson ) ;
97
96
fn next ( & mut self ) -> Option < ( & ' a String , & ' a Bson ) > {
98
97
match self . vec_iter . next ( ) {
99
- Some ( key) => Some ( ( & key, self . document . get ( & key[ ..] ) . unwrap ( ) ) ) ,
98
+ Some ( key) => {
99
+ let val = self . document . get ( & key[ ..] ) . unwrap ( ) ;
100
+ Some ( ( & key, val) )
101
+ } ,
100
102
None => None ,
101
103
}
102
104
}
You can’t perform that action at this time.
0 commit comments