File tree 2 files changed +6
-5
lines changed 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ use kv_log_macro::trace;
21
21
///
22
22
/// See also: [`task::blocking`].
23
23
///
24
- /// [`task::blocking `]: fn.blocking .html
24
+ /// [`task::spawn_blocking `]: fn.spawn_blocking .html
25
25
///
26
26
/// [spawning]: https://doc.rust-lang.org/std/thread/fn.spawn.html
27
27
/// [joining]: https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method.join
Original file line number Diff line number Diff line change @@ -60,9 +60,10 @@ cfg_if::cfg_if! {
60
60
/// is useful to prevent long-running synchronous operations from blocking the main futures
61
61
/// executor.
62
62
///
63
- /// See also: [`task::block_on`].
63
+ /// See also: [`task::block_on`], [`task::spawn`] .
64
64
///
65
65
/// [`task::block_on`]: fn.block_on.html
66
+ /// [`task::spawn`]: fn.spawn.html
66
67
///
67
68
/// # Examples
68
69
///
@@ -73,7 +74,7 @@ cfg_if::cfg_if! {
73
74
/// #
74
75
/// use async_std::task;
75
76
///
76
- /// task::blocking (|| {
77
+ /// task::spawn_blocking (|| {
77
78
/// println!("long-running task here");
78
79
/// }).await;
79
80
/// #
@@ -84,10 +85,10 @@ cfg_if::cfg_if! {
84
85
#[ cfg( any( feature = "unstable" , feature = "docs" ) ) ]
85
86
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
86
87
#[ inline]
87
- pub fn blocking < F , R > ( f : F ) -> task:: JoinHandle < R >
88
+ pub fn spawn_blocking < F , R > ( f : F ) -> task:: JoinHandle < R >
88
89
where
89
90
F : FnOnce ( ) -> R + Send + ' static ,
90
91
R : Send + ' static ,
91
92
{
92
- blocking:: spawn_blocking ( future )
93
+ blocking:: spawn ( f )
93
94
}
You can’t perform that action at this time.
0 commit comments