File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 25
25
//! use futures_lite::stream;
26
26
//!
27
27
//! let v: Vec<_> = vec!["chashu", "nori"]
28
- //! .into_co_stream()
29
- //! .map(|msg| async move { format!("hello {msg}") })
30
- //! .collect()
31
- //! .await;
28
+ //! .into_co_stream()
29
+ //! .map(|msg| async move { format!("hello {msg}") })
30
+ //! .collect()
31
+ //! .await;
32
32
//!
33
- //! assert_eq!(v, &["hello chashu", "hello nori"]);
33
+ //! assert_eq!(v, &["hello chashu", "hello nori"]);
34
34
//! ```
35
35
//!
36
36
//! **Access stack data outside the futures' scope**
44
44
//! let mut num = 0;
45
45
//!
46
46
//! let a = async {
47
- //! println!("hello from the first future");
48
- //! dbg!(&container);
47
+ //! println!("hello from the first future");
48
+ //! dbg!(&container);
49
49
//! };
50
50
//!
51
51
//! let b = async {
52
- //! println!("hello from the second future");
53
- //! num += container[0] + container[2];
52
+ //! println!("hello from the second future");
53
+ //! num += container[0] + container[2];
54
54
//! };
55
55
//!
56
56
//! println!("hello from the main future");
You can’t perform that action at this time.
0 commit comments