Skip to content

Commit

Permalink
Bring crate-level documentation up to date with readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 7, 2019
1 parent 68ad834 commit e23fb80
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/lib.rs
Expand Up @@ -9,27 +9,22 @@
//! `&[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.
//!
//! ```
//! # use serde_derive::{Serialize, Deserialize};
//! use serde::{Serialize, Deserialize};
//! # use serde_derive::{Deserialize, Serialize};
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Serialize)]
//! #[derive(Deserialize, Serialize)]
//! struct Efficient<'a> {
//! #[serde(with = "serde_bytes")]
//! bytes: &'a [u8],
//!
//! #[serde(with = "serde_bytes")]
//! byte_buf: Vec<u8>,
//! }
//!
//! #[derive(Serialize, Deserialize)]
//! struct Packet {
//! #[serde(with = "serde_bytes")]
//! payload: Vec<u8>,
//! }
//! ```

#![doc(html_root_url = "https://docs.rs/serde_bytes/0.10.5")]
Expand Down

0 comments on commit e23fb80

Please sign in to comment.