Skip to content

Commit a47e426

Browse files
committed
RUST-765 Iterator type names match the methods that produce them (C-ITER-TY)
1 parent babbd10 commit a47e426

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/de/serde.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use serde::de::{
1818
use crate::decimal128::Decimal128;
1919
use crate::{
2020
bson::{Binary, Bson, DateTime, DbPointer, JavaScriptCodeWithScope, Regex, Timestamp},
21-
document::{Document, DocumentIntoIterator, DocumentVisitor},
21+
document::{Document, DocumentVisitor, IntoIter},
2222
oid::ObjectId,
2323
spec::BinarySubtype,
2424
};
@@ -611,7 +611,7 @@ impl<'de> SeqAccess<'de> for SeqDeserializer {
611611
}
612612

613613
struct MapDeserializer {
614-
iter: DocumentIntoIterator,
614+
iter: IntoIter,
615615
value: Option<Bson>,
616616
len: usize,
617617
}

src/document.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ impl Debug for Document {
9999
}
100100

101101
/// An iterator over Document entries.
102-
pub struct DocumentIntoIterator {
102+
pub struct IntoIter {
103103
inner: indexmap::map::IntoIter<String, Bson>,
104104
}
105105

106106
/// An owning iterator over Document entries.
107-
pub struct DocumentIterator<'a> {
107+
pub struct Iter<'a> {
108108
inner: indexmap::map::Iter<'a, String, Bson>,
109109
}
110110

@@ -136,21 +136,21 @@ impl<'a> Iterator for Values<'a> {
136136

137137
impl IntoIterator for Document {
138138
type Item = (String, Bson);
139-
type IntoIter = DocumentIntoIterator;
139+
type IntoIter = IntoIter;
140140

141141
fn into_iter(self) -> Self::IntoIter {
142-
DocumentIntoIterator {
142+
IntoIter {
143143
inner: self.inner.into_iter(),
144144
}
145145
}
146146
}
147147

148148
impl<'a> IntoIterator for &'a Document {
149149
type Item = (&'a String, &'a Bson);
150-
type IntoIter = DocumentIterator<'a>;
150+
type IntoIter = Iter<'a>;
151151

152152
fn into_iter(self) -> Self::IntoIter {
153-
DocumentIterator {
153+
Iter {
154154
inner: self.inner.iter(),
155155
}
156156
}
@@ -166,15 +166,15 @@ impl FromIterator<(String, Bson)> for Document {
166166
}
167167
}
168168

169-
impl<'a> Iterator for DocumentIntoIterator {
169+
impl<'a> Iterator for IntoIter {
170170
type Item = (String, Bson);
171171

172172
fn next(&mut self) -> Option<(String, Bson)> {
173173
self.inner.next()
174174
}
175175
}
176176

177-
impl<'a> Iterator for DocumentIterator<'a> {
177+
impl<'a> Iterator for Iter<'a> {
178178
type Item = (&'a String, &'a Bson);
179179

180180
fn next(&mut self) -> Option<(&'a String, &'a Bson)> {
@@ -191,7 +191,7 @@ impl Document {
191191
}
192192

193193
/// Gets an iterator over the entries of the map.
194-
pub fn iter(&self) -> DocumentIterator {
194+
pub fn iter(&self) -> Iter {
195195
self.into_iter()
196196
}
197197

0 commit comments

Comments
 (0)