docs: deal with Result instead of using unwrap (#860)

This commit is contained in:
rmcteggart-r7
2019-01-20 14:21:17 -05:00
committed by Toby Lawrence
parent 983e9d1b67
commit 91f20e33a4
+3 -2
View File
@@ -49,11 +49,12 @@
//! use bytes::Bytes;
//! use futures::{Sink, Future};
//!
//! fn write_frame<T: AsyncRead + AsyncWrite>(io: T) {
//! fn write_frame<T: AsyncRead + AsyncWrite>(io: T) -> Result<(), Box<std::error::Error>> {
//! let mut transport = Framed::new(io, LengthDelimitedCodec::new());
//! let frame = Bytes::from("hello world");
//!
//! transport.send(frame).wait().unwrap();
//! transport.send(frame).wait()?;
//! Ok(())
//! }
//! #
//! # pub fn main() {}