Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ rand = "0.7"
serde = "1.0"
serde_json = { version = "1.0", features = ["preserve_order"] }
time = "0.1"
linked-hash-map = "0.5"
indexmap = "1.3"
hex = "0.3"
md5 = "0.6"
decimal = { version = "2.0.4", default_features = false, optional = true }
Expand Down
4 changes: 1 addition & 3 deletions src/bson.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use serde_json::{Value, json};
#[cfg(feature = "decimal128")]
use crate::decimal128::Decimal128;
use crate::oid;
use crate::ordered::OrderedDocument;
pub use crate::doc::Document;
use crate::spec::{BinarySubtype, ElementType};

/// Possible BSON value types.
Expand Down Expand Up @@ -81,8 +81,6 @@ pub enum Bson {

/// Alias for `Vec<Bson>`.
pub type Array = Vec<Bson>;
/// Alias for `OrderedDocument`.
pub type Document = OrderedDocument;

impl Default for Bson {
fn default() -> Self {
Expand Down
8 changes: 4 additions & 4 deletions src/decoder/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::bson::{Bson, TimeStamp, UtcDateTime};
#[cfg(feature = "decimal128")]
use crate::decimal128::Decimal128;
use crate::oid::ObjectId;
use crate::ordered::{OrderedDocument, OrderedDocumentIntoIterator, OrderedDocumentVisitor};
use crate::doc::{Document, IntoIter, DocumentVisitor};
use crate::spec::BinarySubtype;

pub struct BsonVisitor;
Expand All @@ -33,7 +33,7 @@ impl<'de> Deserialize<'de> for ObjectId {
}
}

impl<'de> Deserialize<'de> for OrderedDocument {
impl<'de> Deserialize<'de> for Document {
/// Deserialize this value given this `Deserializer`.
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>
Expand Down Expand Up @@ -179,7 +179,7 @@ impl<'de> Visitor<'de> for BsonVisitor {
fn visit_map<V>(self, visitor: V) -> Result<Bson, V::Error>
where V: MapAccess<'de>
{
let values = OrderedDocumentVisitor::new().visit_map(visitor)?;
let values = DocumentVisitor::new().visit_map(visitor)?;
Ok(Bson::from_extended_document(values.into()))
}

Expand Down Expand Up @@ -504,7 +504,7 @@ impl<'de> SeqAccess<'de> for SeqDecoder {
}

struct MapDecoder {
iter: OrderedDocumentIntoIterator,
iter: IntoIter<String, Bson>,
value: Option<Bson>,
len: usize,
}
Expand Down
Loading