@@ -46,7 +46,7 @@ use crate::{oid::ObjectId, spec::ElementType, Document};
4646/// # use bson::error::Error;
4747/// use bson::raw::RawDocument;
4848///
49- /// let doc = RawDocument::from_bytes (b"\x13\x00\x00\x00\x02hi\x00\x06\x00\x00\x00y'all\x00\x00")?;
49+ /// let doc = RawDocument::decode_from_bytes (b"\x13\x00\x00\x00\x02hi\x00\x06\x00\x00\x00y'all\x00\x00")?;
5050/// let mut iter = doc.into_iter();
5151/// let (key, value) = iter.next().unwrap()?;
5252/// assert_eq!(key, "hi");
@@ -63,7 +63,7 @@ use crate::{oid::ObjectId, spec::ElementType, Document};
6363/// ```
6464/// use bson::raw::RawDocument;
6565///
66- /// let doc = RawDocument::from_bytes (b"\x13\x00\x00\x00\x02hi\x00\x06\x00\x00\x00y'all\x00\x00")?;
66+ /// let doc = RawDocument::decode_from_bytes (b"\x13\x00\x00\x00\x02hi\x00\x06\x00\x00\x00y'all\x00\x00")?;
6767/// assert_eq!(doc.get_str("hi")?, "y'all");
6868/// # Ok::<(), Box<dyn std::error::Error>>(())
6969/// ```
@@ -89,7 +89,7 @@ impl RawDocument {
8989 /// ```
9090 /// use bson::raw::RawDocument;
9191 ///
92- /// let doc = RawDocument::from_bytes (b"\x05\0\0\0\0")?;
92+ /// let doc = RawDocument::decode_from_bytes (b"\x05\0\0\0\0")?;
9393 /// # Ok::<(), bson::error::Error>(())
9494 /// ```
9595 pub fn decode_from_bytes < D : AsRef < [ u8 ] > + ?Sized > ( data : & D ) -> RawResult < & RawDocument > {
@@ -132,7 +132,7 @@ impl RawDocument {
132132 /// use bson::raw::{RawDocument, RawDocumentBuf};
133133 ///
134134 /// let data = b"\x05\0\0\0\0";
135- /// let doc_ref = RawDocument::from_bytes (data)?;
135+ /// let doc_ref = RawDocument::decode_from_bytes (data)?;
136136 /// let doc: RawDocumentBuf = doc_ref.to_raw_document_buf();
137137 /// # Ok::<(), bson::error::Error>(())
138138 pub fn to_raw_document_buf ( & self ) -> RawDocumentBuf {
0 commit comments