Skip to content

Commit

Permalink
Merge pull request #97 from moka-rs/fix-async-doc
Browse files Browse the repository at this point in the history
Fix the examples in the docs: Replace futures crate with futures-util crate
  • Loading branch information
tatsuya6502 authored Mar 14, 2022
2 parents 89736fa + 4171117 commit b1921fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Here is a similar program to the previous example, but using asynchronous cache
// [dependencies]
// moka = { version = "0.7", features = ["future"] }
// tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
// futures = "0.3"
// futures-util = "0.3"
// Use the asynchronous cache.
use moka::future::Cache;
Expand Down Expand Up @@ -240,7 +240,7 @@ async fn main() {
.collect();
// Wait for all tasks to complete.
futures::future::join_all(tasks).await;
futures_util::future::join_all(tasks).await;
// Verify the result.
for key in 0..(NUM_TASKS * NUM_KEYS_PER_TASK) {
Expand Down
10 changes: 5 additions & 5 deletions src/future/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ use std::{
/// // [dependencies]
/// // moka = { version = "0.7", features = ["future"] }
/// // tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
/// // futures = "0.3"
/// // futures-util = "0.3"
///
/// use moka::future::Cache;
///
Expand Down Expand Up @@ -146,7 +146,7 @@ use std::{
/// // [dependencies]
/// // moka = { version = "0.7", features = ["future"] }
/// // tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
/// // futures = "0.3"
/// // futures-util = "0.3"
///
/// use std::convert::TryInto;
/// use moka::future::Cache;
Expand Down Expand Up @@ -208,7 +208,7 @@ use std::{
/// // [dependencies]
/// // moka = { version = "0.7", features = ["future"] }
/// // tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
/// // futures = "0.3"
/// // futures-util = "0.3"
///
/// use moka::future::Cache;
/// use std::time::Duration;
Expand Down Expand Up @@ -395,7 +395,7 @@ where
/// //
/// // [dependencies]
/// // moka = { version = "0.7", features = ["future"] }
/// // futures = "0.3"
/// // futures-util = "0.3"
/// // tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
/// use moka::future::Cache;
/// use std::sync::Arc;
Expand Down Expand Up @@ -486,7 +486,7 @@ where
/// //
/// // [dependencies]
/// // moka = { version = "0.7", features = ["future"] }
/// // futures = "0.3"
/// // futures-util = "0.3"
/// // reqwest = "0.11"
/// // tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
/// use moka::future::Cache;
Expand Down

0 comments on commit b1921fb

Please sign in to comment.