From 65f554250860fe4bd5cbe3e4224b93a19be0cad5 Mon Sep 17 00:00:00 2001 From: Tim de Jager Date: Mon, 13 Feb 2023 11:27:26 +0100 Subject: [PATCH 1/2] fix: fix wording with 'unsend' --- tokio/src/task/local.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tokio/src/task/local.rs b/tokio/src/task/local.rs index 0675faa1884..d6447805290 100644 --- a/tokio/src/task/local.rs +++ b/tokio/src/task/local.rs @@ -34,14 +34,14 @@ cfg_rt! { /// async fn main() { /// // `Rc` does not implement `Send`, and thus may not be sent between /// // threads safely. - /// let unsend_data = Rc::new("my unsend data..."); + /// let unsent_data = Rc::new("my unsent data..."); /// - /// let unsend_data = unsend_data.clone(); - /// // Because the `async` block here moves `unsend_data`, the future is `!Send`. + /// let unsent_data = unsent_data.clone(); + /// // Because the `async` block here moves `unsent_data`, the future is `!Send`. /// // Since `tokio::spawn` requires the spawned future to implement `Send`, this /// // will not compile. /// tokio::spawn(async move { - /// println!("{}", unsend_data); + /// println!("{}", unsent_data); /// // ... /// }).await.unwrap(); /// } From 2108510134f0d0517e3defe1bef3cdbb79f3aaab Mon Sep 17 00:00:00 2001 From: Tim de Jager Date: Tue, 14 Feb 2023 13:14:51 +0100 Subject: [PATCH 2/2] fix: changed wording to be more correct --- tokio/src/task/local.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tokio/src/task/local.rs b/tokio/src/task/local.rs index d6447805290..b709c215579 100644 --- a/tokio/src/task/local.rs +++ b/tokio/src/task/local.rs @@ -34,14 +34,14 @@ cfg_rt! { /// async fn main() { /// // `Rc` does not implement `Send`, and thus may not be sent between /// // threads safely. - /// let unsent_data = Rc::new("my unsent data..."); + /// let nonsend_data = Rc::new("my nonsend data..."); /// - /// let unsent_data = unsent_data.clone(); - /// // Because the `async` block here moves `unsent_data`, the future is `!Send`. + /// let nonsend_data = nonsend_data.clone(); + /// // Because the `async` block here moves `nonsend_data`, the future is `!Send`. /// // Since `tokio::spawn` requires the spawned future to implement `Send`, this /// // will not compile. /// tokio::spawn(async move { - /// println!("{}", unsent_data); + /// println!("{}", nonsend_data); /// // ... /// }).await.unwrap(); /// } @@ -60,18 +60,18 @@ cfg_rt! { /// /// #[tokio::main] /// async fn main() { - /// let unsend_data = Rc::new("my unsend data..."); + /// let nonsend_data = Rc::new("my nonsend data..."); /// /// // Construct a local task set that can run `!Send` futures. /// let local = task::LocalSet::new(); /// /// // Run the local task set. /// local.run_until(async move { - /// let unsend_data = unsend_data.clone(); + /// let nonsend_data = nonsend_data.clone(); /// // `spawn_local` ensures that the future is spawned on the local /// // task set. /// task::spawn_local(async move { - /// println!("{}", unsend_data); + /// println!("{}", nonsend_data); /// // ... /// }).await.unwrap(); /// }).await; @@ -94,18 +94,18 @@ cfg_rt! { /// /// #[tokio::main] /// async fn main() { - /// let unsend_data = Rc::new("world"); + /// let nonsend_data = Rc::new("world"); /// let local = task::LocalSet::new(); /// - /// let unsend_data2 = unsend_data.clone(); + /// let nonsend_data2 = nonsend_data.clone(); /// local.spawn_local(async move { /// // ... - /// println!("hello {}", unsend_data2) + /// println!("hello {}", nonsend_data2) /// }); /// /// local.spawn_local(async move { /// time::sleep(time::Duration::from_millis(100)).await; - /// println!("goodbye {}", unsend_data) + /// println!("goodbye {}", nonsend_data) /// }); /// /// // ... @@ -309,15 +309,15 @@ cfg_rt! { /// /// #[tokio::main] /// async fn main() { - /// let unsend_data = Rc::new("my unsend data..."); + /// let nonsend_data = Rc::new("my nonsend data..."); /// /// let local = task::LocalSet::new(); /// /// // Run the local task set. /// local.run_until(async move { - /// let unsend_data = unsend_data.clone(); + /// let nonsend_data = nonsend_data.clone(); /// task::spawn_local(async move { - /// println!("{}", unsend_data); + /// println!("{}", nonsend_data); /// // ... /// }).await.unwrap(); /// }).await;