Fix rustdoc comment syntax

I also moved the comment block to the top of the file so that rustdoc won't throw "expected outer comment" error
This commit is contained in:
Mohd Tarmizi 2015-04-27 21:36:59 +08:00
parent 98fbf38c01
commit 4e0f2457ac
1 changed files with 25 additions and 25 deletions

View File

@ -1,3 +1,28 @@
//! `bincode` is a crate for encoding and decoding using a tiny binary
//! serialization strategy.
//!
//! There are simple functions for encoding to `Vec<u8>` and decoding from
//! `&[u8]`, but the meat of the library is the `encode_into` and `decode_from`
//! functions which respectively allow encoding into a `std::io::Writer`
//! and decoding from a `std::io::Buffer`.
//!
//! ### Using Basic Functions
//!
//! ```rust
//! #![allow(unstable)]
//! extern crate bincode;
//! fn main() {
//! // The object that we will serialize.
//! let target = Some("hello world".to_string());
//! // The maximum size of the encoded message.
//! let limit = bincode::SizeLimit::Bounded(20);
//!
//! let encoded: Vec<u8> = bincode::encode(&target, limit).unwrap();
//! let decoded: Option<String> = bincode::decode(&encoded[..]).unwrap();
//! assert_eq!(target, decoded);
//! }
//! ```
#![crate_name = "bincode"]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
@ -22,31 +47,6 @@ mod reader;
mod refbox;
#[cfg(test)] mod test;
///! `bincode` is a crate for encoding and decoding using a tiny binary
///! serialization strategy.
///!
///! There are simple functions for encoding to `Vec<u8>` and decoding from
///! `&[u8]`, but the meat of the library is the `encode_into` and `decode_from`
///! functions which respectively allow encoding into a `std::io::Writer`
///! and decoding from a `std::io::Buffer`.
///!
///! ### Using Basic Functions
///!
///! ```rust
///! #![allow(unstable)]
///! extern crate bincode;
///! fn main() {
///! // The object that we will serialize.
///! let target = Some("hello world".to_string());
///! // The maximum size of the encoded message.
///! let limit = bincode::SizeLimit::Bounded(20);
///!
///! let encoded: Vec<u8> = bincode::encode(&target, limit).unwrap();
///! let decoded: Option<String> = bincode::decode(&encoded[..]).unwrap();
///! assert_eq!(target, decoded);
///! }
///! ```
/// A limit on the amount of bytes that can be read or written.
///
/// Size limits are an incredibly important part of both encoding and decoding.