@@ -24,7 +24,7 @@ const BLOCKED: usize = 1 << 1;
2424/// # Examples
2525///
2626/// ```
27- /// # fn main() { async_std::task::block_on(async {
27+ /// # async_std::task::block_on(async {
2828/// #
2929/// use std::sync::Arc;
3030///
@@ -46,7 +46,7 @@ const BLOCKED: usize = 1 << 1;
4646/// }
4747/// assert_eq!(*m.lock().await, 10);
4848/// #
49- /// # }) }
49+ /// # })
5050/// ```
5151pub struct Mutex < T > {
5252 state : AtomicUsize ,
@@ -82,7 +82,7 @@ impl<T> Mutex<T> {
8282 /// # Examples
8383 ///
8484 /// ```
85- /// # fn main() { async_std::task::block_on(async {
85+ /// # async_std::task::block_on(async {
8686 /// #
8787 /// use std::sync::Arc;
8888 ///
@@ -99,7 +99,7 @@ impl<T> Mutex<T> {
9999 ///
100100 /// assert_eq!(*m2.lock().await, 20);
101101 /// #
102- /// # }) }
102+ /// # })
103103 /// ```
104104 pub async fn lock ( & self ) -> MutexGuard < ' _ , T > {
105105 pub struct LockFuture < ' a , T > {
@@ -196,7 +196,7 @@ impl<T> Mutex<T> {
196196 /// # Examples
197197 ///
198198 /// ```
199- /// # fn main() { async_std::task::block_on(async {
199+ /// # async_std::task::block_on(async {
200200 /// #
201201 /// use std::sync::Arc;
202202 ///
@@ -217,7 +217,7 @@ impl<T> Mutex<T> {
217217 ///
218218 /// assert_eq!(*m2.lock().await, 20);
219219 /// #
220- /// # }) }
220+ /// # })
221221 /// ```
222222 pub fn try_lock ( & self ) -> Option < MutexGuard < ' _ , T > > {
223223 if self . state . fetch_or ( LOCK , Ordering :: Acquire ) & LOCK == 0 {
@@ -249,15 +249,15 @@ impl<T> Mutex<T> {
249249 /// # Examples
250250 ///
251251 /// ```
252- /// # fn main() { async_std::task::block_on(async {
252+ /// # async_std::task::block_on(async {
253253 /// #
254254 /// use async_std::sync::Mutex;
255255 ///
256256 /// let mut mutex = Mutex::new(0);
257257 /// *mutex.get_mut() = 10;
258258 /// assert_eq!(*mutex.lock().await, 10);
259259 /// #
260- /// # }) }
260+ /// # })
261261 /// ```
262262 pub fn get_mut ( & mut self ) -> & mut T {
263263 unsafe { & mut * self . value . get ( ) }
0 commit comments