File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,24 @@ You can find the full code [here][full].
96
96
97
97
[ full ] : https://github.com/tokio-rs/website/blob/master/tutorial-code/hello-tokio/src/main.rs
98
98
99
+ # Troubleshooting
100
+
101
+ A common mistake is to forget to add ` .await ` on calls to asynchronous
102
+ functions. This is particularly easy to forget for functions where the return
103
+ value is not used by the application. The compiler warns you and teaches you how
104
+ to fix this error.
105
+
106
+ ``` plain
107
+ warning: unused implementer of `std::future::Future` that must be used
108
+ --> examples/hello-redis.rs:12:5
109
+ |
110
+ 12 | client.set("hello", "world".into());
111
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112
+ |
113
+ = note: futures do nothing unless you `.await` or poll them
114
+ = note: `#[warn(unused_must_use)]` on by default
115
+ ```
116
+
99
117
# Breaking it down
100
118
101
119
Let's take some time to go over what we just did. There isn't much code, but a
You can’t perform that action at this time.
0 commit comments