Skip to content

Commit 09258b2

Browse files
committed
Fix imports in doctests
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
1 parent 53ea9fe commit 09258b2

File tree

2 files changed

+43
-26
lines changed

2 files changed

+43
-26
lines changed

src/length_delimited.rs

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,9 @@ impl Builder {
571571
/// # Examples
572572
///
573573
/// ```
574-
/// # use tokio_io::AsyncRead;
575-
/// use tokio_io::codec::length_delimited::Builder;
574+
/// # extern crate tokio;
575+
/// # use tokio::io::AsyncRead;
576+
/// use tokio::codec::length_delimited::Builder;
576577
///
577578
/// # fn bind_read<T: AsyncRead>(io: T) {
578579
/// Builder::new()
@@ -614,8 +615,9 @@ impl Builder {
614615
/// # Examples
615616
///
616617
/// ```
617-
/// # use tokio_io::AsyncRead;
618-
/// use tokio_io::codec::length_delimited::Builder;
618+
/// # extern crate tokio;
619+
/// # use tokio::io::AsyncRead;
620+
/// use tokio::codec::length_delimited::Builder;
619621
///
620622
/// # fn bind_read<T: AsyncRead>(io: T) {
621623
/// Builder::new()
@@ -637,8 +639,9 @@ impl Builder {
637639
/// # Examples
638640
///
639641
/// ```
640-
/// # use tokio_io::AsyncRead;
641-
/// use tokio_io::codec::length_delimited::Builder;
642+
/// # extern crate tokio;
643+
/// # use tokio::io::AsyncRead;
644+
/// use tokio::codec::length_delimited::Builder;
642645
///
643646
/// # fn bind_read<T: AsyncRead>(io: T) {
644647
/// Builder::new()
@@ -660,8 +663,9 @@ impl Builder {
660663
/// # Examples
661664
///
662665
/// ```
663-
/// # use tokio_io::AsyncRead;
664-
/// use tokio_io::codec::length_delimited::Builder;
666+
/// # extern crate tokio;
667+
/// # use tokio::io::AsyncRead;
668+
/// use tokio::codec::length_delimited::Builder;
665669
///
666670
/// # fn bind_read<T: AsyncRead>(io: T) {
667671
/// Builder::new()
@@ -693,8 +697,9 @@ impl Builder {
693697
/// # Examples
694698
///
695699
/// ```
696-
/// # use tokio_io::AsyncRead;
697-
/// use tokio_io::codec::length_delimited::Builder;
700+
/// # extern crate tokio;
701+
/// # use tokio::io::AsyncRead;
702+
/// use tokio::codec::length_delimited::Builder;
698703
///
699704
/// # fn bind_read<T: AsyncRead>(io: T) {
700705
/// Builder::new()
@@ -716,8 +721,9 @@ impl Builder {
716721
/// # Examples
717722
///
718723
/// ```
719-
/// # use tokio_io::AsyncRead;
720-
/// use tokio_io::codec::length_delimited::Builder;
724+
/// # extern crate tokio;
725+
/// # use tokio::io::AsyncRead;
726+
/// use tokio::codec::length_delimited::Builder;
721727
///
722728
/// # fn bind_read<T: AsyncRead>(io: T) {
723729
/// Builder::new()
@@ -738,8 +744,9 @@ impl Builder {
738744
/// # Examples
739745
///
740746
/// ```
741-
/// # use tokio_io::AsyncRead;
742-
/// use tokio_io::codec::length_delimited::Builder;
747+
/// # extern crate tokio;
748+
/// # use tokio::io::AsyncRead;
749+
/// use tokio::codec::length_delimited::Builder;
743750
///
744751
/// # fn bind_read<T: AsyncRead>(io: T) {
745752
/// Builder::new()
@@ -758,8 +765,9 @@ impl Builder {
758765
/// # Examples
759766
///
760767
/// ```
761-
/// # use tokio_io::AsyncRead;
762-
/// use tokio_io::codec::length_delimited::Builder;
768+
/// # extern crate tokio;
769+
/// # use tokio::io::AsyncRead;
770+
/// use tokio::codec::length_delimited::Builder;
763771
///
764772
/// # fn bind_read<T: AsyncRead>(io: T) {
765773
/// Builder::new()
@@ -781,8 +789,9 @@ impl Builder {
781789
/// # Examples
782790
///
783791
/// ```
784-
/// # use tokio_io::AsyncRead;
785-
/// use tokio_io::codec::length_delimited::Builder;
792+
/// # extern crate tokio;
793+
/// # use tokio::io::AsyncRead;
794+
/// use tokio::codec::length_delimited::Builder;
786795
///
787796
/// # fn bind_read<T: AsyncRead>(io: T) {
788797
/// Builder::new()
@@ -800,8 +809,9 @@ impl Builder {
800809
/// # Examples
801810
///
802811
/// ```
803-
/// # use tokio_io::AsyncRead;
804-
/// use tokio_io::codec::length_delimited::Builder;
812+
/// # extern crate tokio;
813+
/// # use tokio::io::AsyncRead;
814+
/// use tokio::codec::length_delimited::Builder;
805815
///
806816
/// # fn bind_read<T: AsyncRead>(io: T) {
807817
/// Builder::new()
@@ -828,10 +838,10 @@ impl Builder {
828838
/// # Examples
829839
///
830840
/// ```
831-
/// # extern crate tokio_io;
841+
/// # extern crate tokio;
832842
/// # extern crate bytes;
833-
/// # use tokio_io::AsyncWrite;
834-
/// # use tokio_io::codec::length_delimited;
843+
/// # use tokio::io::AsyncWrite;
844+
/// # use tokio::codec::length_delimited;
835845
/// # use bytes::BytesMut;
836846
/// # fn write_frame<T: AsyncWrite>(io: T) {
837847
/// # let _: length_delimited::FramedWrite<T, BytesMut> =
@@ -857,10 +867,10 @@ impl Builder {
857867
/// # Examples
858868
///
859869
/// ```
860-
/// # extern crate tokio_io;
870+
/// # extern crate tokio;
861871
/// # extern crate bytes;
862-
/// # use tokio_io::{AsyncRead, AsyncWrite};
863-
/// # use tokio_io::codec::length_delimited;
872+
/// # use tokio::io::{AsyncRead, AsyncWrite};
873+
/// # use tokio::codec::length_delimited;
864874
/// # use bytes::BytesMut;
865875
/// # fn write_frame<T: AsyncRead + AsyncWrite>(io: T) {
866876
/// # let _: length_delimited::Framed<T, BytesMut> =

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ pub mod codec {
140140
//! configuration values.
141141
//!
142142
//! ```
143+
//! # extern crate tokio_io;
143144
//! use tokio_io::{AsyncRead, AsyncWrite};
144145
//! use tokio_io::codec::length_delimited;
145146
//!
@@ -204,6 +205,7 @@ pub mod codec {
204205
//! frame head in the yielded `BytesMut`.
205206
//!
206207
//! ```
208+
//! # extern crate tokio_io;
207209
//! # use tokio_io::AsyncRead;
208210
//! # use tokio_io::codec::length_delimited;
209211
//! # fn bind_read<T: AsyncRead>(io: T) {
@@ -237,6 +239,7 @@ pub mod codec {
237239
//! frame head in the yielded `BytesMut`.
238240
//!
239241
//! ```
242+
//! # extern crate tokio_io;
240243
//! # use tokio_io::AsyncRead;
241244
//! # use tokio_io::codec::length_delimited;
242245
//! # fn bind_read<T: AsyncRead>(io: T) {
@@ -268,6 +271,7 @@ pub mod codec {
268271
//! **includes** the frame head length.
269272
//!
270273
//! ```
274+
//! # extern crate tokio_io;
271275
//! # use tokio_io::AsyncRead;
272276
//! # use tokio_io::codec::length_delimited;
273277
//! # fn bind_read<T: AsyncRead>(io: T) {
@@ -301,6 +305,7 @@ pub mod codec {
301305
//! frame head, including the frame head in the yielded `BytesMut`.
302306
//!
303307
//! ```
308+
//! # extern crate tokio_io;
304309
//! # use tokio_io::AsyncRead;
305310
//! # use tokio_io::codec::length_delimited;
306311
//! # fn bind_read<T: AsyncRead>(io: T) {
@@ -344,6 +349,7 @@ pub mod codec {
344349
//! included.
345350
//!
346351
//! ```
352+
//! # extern crate tokio_io;
347353
//! # use tokio_io::AsyncRead;
348354
//! # use tokio_io::codec::length_delimited;
349355
//! # fn bind_read<T: AsyncRead>(io: T) {
@@ -389,6 +395,7 @@ pub mod codec {
389395
//! length.
390396
//!
391397
//! ```
398+
//! # extern crate tokio_io;
392399
//! # use tokio_io::AsyncRead;
393400
//! # use tokio_io::codec::length_delimited;
394401
//! # fn bind_read<T: AsyncRead>(io: T) {

0 commit comments

Comments
 (0)