Skip to content

Commit

Permalink
Merge pull request 1898 from Mingun/bytes-into-deserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 24, 2021
2 parents e24dbc4 + db3074a commit 1f9f72b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions serde/src/de/value.rs
Expand Up @@ -684,6 +684,17 @@ impl<'a, E> BytesDeserializer<'a, E> {

impl_copy_clone!(BytesDeserializer<'a>);

impl<'de, 'a, E> IntoDeserializer<'de, E> for &'a [u8]
where
E: de::Error,
{
type Deserializer = BytesDeserializer<'a, E>;

fn into_deserializer(self) -> BytesDeserializer<'a, E> {
BytesDeserializer::new(self)
}
}

impl<'de, 'a, E> Deserializer<'de> for BytesDeserializer<'a, E>
where
E: de::Error,
Expand Down

0 comments on commit 1f9f72b

Please sign in to comment.