From 352f18bc2a404b755dd7cd021ca50b3a79a7cc14 Mon Sep 17 00:00:00 2001 From: Stjepan Glavina Date: Mon, 11 Nov 2019 11:10:36 +0100 Subject: [PATCH] Use async_std::sync::Arc in examples (#501) --- src/stream/from_fn.rs | 3 +-- src/sync/mod.rs | 4 +--- src/sync/mutex.rs | 12 +++--------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/stream/from_fn.rs b/src/stream/from_fn.rs index a28a901..f7a421f 100644 --- a/src/stream/from_fn.rs +++ b/src/stream/from_fn.rs @@ -34,8 +34,7 @@ pin_project! { /// # async_std::task::block_on(async { /// # /// use async_std::prelude::*; -/// use async_std::sync::Mutex; -/// use std::sync::Arc; +/// use async_std::sync::{Arc, Mutex}; /// use async_std::stream; /// /// let count = Arc::new(Mutex::new(0u8)); diff --git a/src/sync/mod.rs b/src/sync/mod.rs index fdeb48c..088c520 100644 --- a/src/sync/mod.rs +++ b/src/sync/mod.rs @@ -155,9 +155,7 @@ //! ``` //! # async_std::task::block_on(async { //! # -//! use std::sync::Arc; -//! -//! use async_std::sync::Mutex; +//! use async_std::sync::{Arc, Mutex}; //! use async_std::task; //! //! let m1 = Arc::new(Mutex::new(0)); diff --git a/src/sync/mutex.rs b/src/sync/mutex.rs index 5bec6a2..2c0ac0c 100644 --- a/src/sync/mutex.rs +++ b/src/sync/mutex.rs @@ -19,9 +19,7 @@ use crate::task::{Context, Poll}; /// ``` /// # async_std::task::block_on(async { /// # -/// use std::sync::Arc; -/// -/// use async_std::sync::Mutex; +/// use async_std::sync::{Arc, Mutex}; /// use async_std::task; /// /// let m = Arc::new(Mutex::new(0)); @@ -77,9 +75,7 @@ impl Mutex { /// ``` /// # async_std::task::block_on(async { /// # - /// use std::sync::Arc; - /// - /// use async_std::sync::Mutex; + /// use async_std::sync::{Arc, Mutex}; /// use async_std::task; /// /// let m1 = Arc::new(Mutex::new(10)); @@ -155,9 +151,7 @@ impl Mutex { /// ``` /// # async_std::task::block_on(async { /// # - /// use std::sync::Arc; - /// - /// use async_std::sync::Mutex; + /// use async_std::sync::{Arc, Mutex}; /// use async_std::task; /// /// let m1 = Arc::new(Mutex::new(10));