From e23fb8008497fa4a3b07db1f8a7a68bdf5cedb9e Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 7 Apr 2019 16:07:34 -0700 Subject: [PATCH] Bring crate-level documentation up to date with readme --- src/lib.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index bb1b63d..f7696db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,14 +9,15 @@ //! `&[u8]` by wrapping it in `serde_bytes::Bytes` and `Vec` by wrapping it //! in `serde_bytes::ByteBuf`. //! -//! This crate supports the Serde `with` attribute to enable efficient handling -//! of `&[u8]` and `Vec` in structs without needing a wrapper type. +//! Additionally this crate supports the Serde `with` attribute to enable +//! efficient handling of `&[u8]` and `Vec` 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], @@ -24,12 +25,6 @@ //! #[serde(with = "serde_bytes")] //! byte_buf: Vec, //! } -//! -//! #[derive(Serialize, Deserialize)] -//! struct Packet { -//! #[serde(with = "serde_bytes")] -//! payload: Vec, -//! } //! ``` #![doc(html_root_url = "https://docs.rs/serde_bytes/0.10.5")]