Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #158 from dtolnay/mapping
Browse files Browse the repository at this point in the history
Make mapping module public
  • Loading branch information
dtolnay committed May 10, 2020
2 parents c49f115 + 56ae019 commit 7cb74ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Expand Up @@ -88,10 +88,12 @@

pub use crate::de::{from_reader, from_slice, from_str};
pub use crate::error::{Error, Location, Result};
pub use crate::mapping::Mapping;
pub use crate::ser::{to_string, to_vec, to_writer};
pub use crate::value::{from_value, to_value, Index, Number, Sequence, Value};

#[doc(inline)]
pub use crate::mapping::Mapping;

/// Entry points for deserializing with pre-existing state.
///
/// These functions are only exposed this way because we don't yet expose a
Expand All @@ -103,7 +105,7 @@ pub mod seed {

mod de;
mod error;
mod mapping;
pub mod mapping;
mod number;
mod path;
mod ser;
Expand Down
5 changes: 5 additions & 0 deletions src/mapping.rs
@@ -1,3 +1,5 @@
//! A YAML mapping and its iterator types.

use crate::Value;
use linked_hash_map::LinkedHashMap;
use serde::{Deserialize, Deserializer, Serialize};
Expand Down Expand Up @@ -175,6 +177,7 @@ macro_rules! delegate_iterator {
}
}

/// Iterator over `&serde_yaml::Mapping`.
pub struct Iter<'a> {
iter: linked_hash_map::Iter<'a, Value, Value>,
}
Expand All @@ -192,6 +195,7 @@ impl<'a> IntoIterator for &'a Mapping {
}
}

/// Iterator over `&mut serde_yaml::Mapping`.
pub struct IterMut<'a> {
iter: linked_hash_map::IterMut<'a, Value, Value>,
}
Expand All @@ -209,6 +213,7 @@ impl<'a> IntoIterator for &'a mut Mapping {
}
}

/// Iterator over `serde_yaml::Mapping` by value.
pub struct IntoIter {
iter: linked_hash_map::IntoIter<Value, Value>,
}
Expand Down

0 comments on commit 7cb74ac

Please sign in to comment.