Skip to content

Add Clone and Debug impls to map iterators #1264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ impl<'a> IntoIterator for &'a Map<String, Value> {
}

/// An iterator over a serde_json::Map's entries.
#[derive(Clone, Debug)]
pub struct Iter<'a> {
iter: IterImpl<'a>,
}
Expand All @@ -1081,6 +1082,7 @@ impl<'a> IntoIterator for &'a mut Map<String, Value> {
}

/// A mutable iterator over a serde_json::Map's entries.
#[derive(Debug)]
pub struct IterMut<'a> {
iter: IterMutImpl<'a>,
}
Expand All @@ -1106,6 +1108,7 @@ impl IntoIterator for Map<String, Value> {
}

/// An owning iterator over a serde_json::Map's entries.
#[derive(Debug)]
pub struct IntoIter {
iter: IntoIterImpl,
}
Expand All @@ -1120,6 +1123,7 @@ delegate_iterator!((IntoIter) => (String, Value));
//////////////////////////////////////////////////////////////////////////////

/// An iterator over a serde_json::Map's keys.
#[derive(Clone, Debug)]
pub struct Keys<'a> {
iter: KeysImpl<'a>,
}
Expand All @@ -1134,6 +1138,7 @@ delegate_iterator!((Keys<'a>) => &'a String);
//////////////////////////////////////////////////////////////////////////////

/// An iterator over a serde_json::Map's values.
#[derive(Clone, Debug)]
pub struct Values<'a> {
iter: ValuesImpl<'a>,
}
Expand All @@ -1148,6 +1153,7 @@ delegate_iterator!((Values<'a>) => &'a Value);
//////////////////////////////////////////////////////////////////////////////

/// A mutable iterator over a serde_json::Map's values.
#[derive(Debug)]
pub struct ValuesMut<'a> {
iter: ValuesMutImpl<'a>,
}
Expand All @@ -1162,6 +1168,7 @@ delegate_iterator!((ValuesMut<'a>) => &'a mut Value);
//////////////////////////////////////////////////////////////////////////////

/// An owning iterator over a serde_json::Map's values.
#[derive(Debug)]
pub struct IntoValues {
iter: IntoValuesImpl,
}
Expand Down