Skip to content

Commit

Permalink
Touch up documentation from PR #1917
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 23, 2021
1 parent 85de92e commit 0b5c56b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions serde/src/de/value.rs
Expand Up @@ -665,17 +665,15 @@ where

////////////////////////////////////////////////////////////////////////////////

/// A deserializer holding a `&[u8]`. Always call [`Visitor::visit_bytes`]
///
/// [`Visitor::visit_bytes`]: ../struct.Visitor.html#method.visit_bytes
/// A deserializer holding a `&[u8]`. Always calls [`Visitor::visit_bytes`].
#[derive(Debug)]
pub struct BytesDeserializer<'a, E> {
value: &'a [u8],
marker: PhantomData<E>,
}

impl<'a, E> BytesDeserializer<'a, E> {
/// Create a new deserializer from the given value.
/// Create a new deserializer from the given bytes.
pub fn new(value: &'a [u8]) -> Self {
BytesDeserializer {
value: value,
Expand Down Expand Up @@ -707,17 +705,15 @@ where
}

/// A deserializer holding a `&[u8]` with a lifetime tied to another
/// deserializer. Always call [`Visitor::visit_borrowed_bytes`]
///
/// [`Visitor::visit_borrowed_bytes`]: ../struct.Visitor.html#method.visit_borrowed_bytes
/// deserializer. Always calls [`Visitor::visit_borrowed_bytes`].
#[derive(Debug)]
pub struct BorrowedBytesDeserializer<'de, E> {
value: &'de [u8],
marker: PhantomData<E>,
}

impl<'de, E> BorrowedBytesDeserializer<'de, E> {
/// Create a new borrowed deserializer from the given value.
/// Create a new borrowed deserializer from the given borrowed bytes.
pub fn new(value: &'de [u8]) -> Self {
BorrowedBytesDeserializer {
value: value,
Expand Down

0 comments on commit 0b5c56b

Please sign in to comment.