Skip to content

Commit

Permalink
Add subheadings to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 7, 2019
1 parent ff68c12 commit e1dd7f8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Wrapper types to enable optimized handling of `&[u8]` and `Vec<u8>`.

## Explanation

Without specialization, Rust forces Serde to treat `&[u8]` just like any
other slice and `Vec<u8>` just like any other vector. In reality this
particular slice and vector can often be serialized and deserialized in a
Expand All @@ -11,8 +13,10 @@ When working with such a format, you can opt into specialized handling of
`&[u8]` by wrapping it in `serde_bytes::Bytes` and `Vec<u8>` by wrapping it
in `serde_bytes::ByteBuf`.

This crate supports the Serde `with` attribute to enable efficient handling
of `&[u8]` and `Vec<u8>` in structs without needing a wrapper type.
Additionally this crate supports the Serde `with` attribute to enable efficient
handling of `&[u8]` and `Vec<u8>` in structs without needing a wrapper type.

## Example

```rust
use serde::{Deserialize, Serialize};
Expand Down

0 comments on commit e1dd7f8

Please sign in to comment.