summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorihc童鞋@提不起劲 <[email protected]>2023-06-02 14:45:52 +0800
committerGitHub <[email protected]>2023-06-02 14:45:52 +0800
commit3d46a81951b1cdf0fc61bb52204f750bca7ca19a (patch)
tree6550be84c3fa95c261ed267c27ac825aa6d3446e /docs
parentb58e53da264e7ec667d7bd11472740ee12bd9706 (diff)
refactor: deprecate pin and use std pin; upgrade dependencies (#174)
Diffstat (limited to 'docs')
-rw-r--r--docs/en/io-cancel.md6
-rw-r--r--docs/zh/io-cancel.md6
2 files changed, 4 insertions, 8 deletions
diff --git a/docs/en/io-cancel.md b/docs/en/io-cancel.md
index cec6d7e..9e2bc90 100644
--- a/docs/en/io-cancel.md
+++ b/docs/en/io-cancel.md
@@ -46,10 +46,8 @@ let mut buf = vec![0; 1024];
let canceler = monoio::io::Canceller::new();
let handle = canceler.handle();
-let timer = monoio::time::sleep(std::time::Duration::from_millis(100));
-monoio::pin!(timer);
-let recv = conn.cancelable_read(buf, handle);
-monoio::pin!(recv);
+let mut timer = std::pin::pin!(monoio::time::sleep(std::time::Duration::from_millis(100)));
+let mut recv = std::pin::pin!(conn.cancelable_read(buf, handle));
monoio::select! {
_ = &mut timer => {
diff --git a/docs/zh/io-cancel.md b/docs/zh/io-cancel.md
index 1d76737..8337c90 100644
--- a/docs/zh/io-cancel.md
+++ b/docs/zh/io-cancel.md
@@ -46,10 +46,8 @@ let mut buf = vec![0; 1024];
let canceler = monoio::io::Canceller::new();
let handle = canceler.handle();
-let timer = monoio::time::sleep(std::time::Duration::from_millis(100));
-monoio::pin!(timer);
-let recv = conn.cancelable_read(buf, handle);
-monoio::pin!(recv);
+let mut timer = std::pin::pin!(monoio::time::sleep(std::time::Duration::from_millis(100)));
+let mut recv = std::pin::pin!(conn.cancelable_read(buf, handle));
monoio::select! {
_ = &mut timer => {