Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 352f18b

Browse files
author
Stjepan Glavina
authored
Use async_std::sync::Arc in examples (#501)
1 parent 417b548 commit 352f18b

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

‎src/stream/from_fn.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ pin_project! {
3434
/// # async_std::task::block_on(async {
3535
/// #
3636
/// use async_std::prelude::*;
37-
/// use async_std::sync::Mutex;
38-
/// use std::sync::Arc;
37+
/// use async_std::sync::{Arc, Mutex};
3938
/// use async_std::stream;
4039
///
4140
/// let count = Arc::new(Mutex::new(0u8));

‎src/sync/mod.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@
155155
//! ```
156156
//! # async_std::task::block_on(async {
157157
//! #
158-
//! use std::sync::Arc;
159-
//!
160-
//! use async_std::sync::Mutex;
158+
//! use async_std::sync::{Arc, Mutex};
161159
//! use async_std::task;
162160
//!
163161
//! let m1 = Arc::new(Mutex::new(0));

‎src/sync/mutex.rs‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ use crate::task::{Context, Poll};
1919
/// ```
2020
/// # async_std::task::block_on(async {
2121
/// #
22-
/// use std::sync::Arc;
23-
///
24-
/// use async_std::sync::Mutex;
22+
/// use async_std::sync::{Arc, Mutex};
2523
/// use async_std::task;
2624
///
2725
/// let m = Arc::new(Mutex::new(0));
@@ -77,9 +75,7 @@ impl<T> Mutex<T> {
7775
/// ```
7876
/// # async_std::task::block_on(async {
7977
/// #
80-
/// use std::sync::Arc;
81-
///
82-
/// use async_std::sync::Mutex;
78+
/// use async_std::sync::{Arc, Mutex};
8379
/// use async_std::task;
8480
///
8581
/// let m1 = Arc::new(Mutex::new(10));
@@ -155,9 +151,7 @@ impl<T> Mutex<T> {
155151
/// ```
156152
/// # async_std::task::block_on(async {
157153
/// #
158-
/// use std::sync::Arc;
159-
///
160-
/// use async_std::sync::Mutex;
154+
/// use async_std::sync::{Arc, Mutex};
161155
/// use async_std::task;
162156
///
163157
/// let m1 = Arc::new(Mutex::new(10));

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /