Skip to content

Commit 8cf7496

Browse files
committed
Swap OrderedDocument iterator names
1 parent 8f2a127 commit 8cf7496

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/ordered.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ pub struct OrderedDocument {
1111

1212
/// An iterator over OrderedDocument entries.
1313
#[derive(Clone)]
14-
pub struct OrderedDocumentIterator {
14+
pub struct OrderedDocumentIntoIterator {
1515
ordered_document: OrderedDocument,
1616
index: usize,
1717
}
1818

1919
/// An owning iterator over OrderedDocument entries.
2020
#[derive(Clone)]
21-
pub struct OrderedDocumentIntoIterator<'a> {
21+
pub struct OrderedDocumentIterator<'a> {
2222
ordered_document: &'a OrderedDocument,
2323
index: usize,
2424
}
2525

2626
/// An iterator over an OrderedDocument's keys.
2727
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>
2929
}
3030

3131
/// An iterator over an OrderedDocument's values.
3232
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>
3434
}
3535

3636
impl<'a> Clone for Keys<'a> {
@@ -54,19 +54,19 @@ impl<'a> Iterator for Values<'a> {
5454

5555
impl IntoIterator for OrderedDocument {
5656
type Item = (String, Bson);
57-
type IntoIter = OrderedDocumentIterator;
57+
type IntoIter = OrderedDocumentIntoIterator;
5858

5959
fn into_iter(self) -> Self::IntoIter {
60-
OrderedDocumentIterator { ordered_document: self, index: 0 }
60+
OrderedDocumentIntoIterator { ordered_document: self, index: 0 }
6161
}
6262
}
6363

6464
impl<'a> IntoIterator for &'a OrderedDocument {
6565
type Item = (&'a String, &'a Bson);
66-
type IntoIter = OrderedDocumentIntoIterator<'a>;
66+
type IntoIter = OrderedDocumentIterator<'a>;
6767

6868
fn into_iter(self) -> Self::IntoIter {
69-
OrderedDocumentIntoIterator { ordered_document: self, index: 0 }
69+
OrderedDocumentIterator { ordered_document: self, index: 0 }
7070
}
7171
}
7272

@@ -80,7 +80,7 @@ impl FromIterator<(String, Bson)> for OrderedDocument {
8080
}
8181
}
8282

83-
impl<'a> Iterator for OrderedDocumentIterator {
83+
impl<'a> Iterator for OrderedDocumentIntoIterator {
8484
type Item = (String, Bson);
8585
fn next(&mut self) -> Option<(String, Bson)> {
8686
if self.ordered_document.keys.len() <= self.index {
@@ -94,7 +94,7 @@ impl<'a> Iterator for OrderedDocumentIterator {
9494
}
9595
}
9696

97-
impl<'a> Iterator for OrderedDocumentIntoIterator<'a> {
97+
impl<'a> Iterator for OrderedDocumentIterator<'a> {
9898
type Item = (&'a String, &'a Bson);
9999
fn next(&mut self) -> Option<(&'a String, &'a Bson)> {
100100
if self.ordered_document.keys.len() <= self.index {
@@ -118,7 +118,7 @@ impl OrderedDocument {
118118
}
119119

120120
/// 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> {
122122
self.into_iter()
123123
}
124124

0 commit comments

Comments
 (0)