We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc3a39d commit 6c90721Copy full SHA for 6c90721
src/doc/book/patterns.md
@@ -196,8 +196,16 @@ let (x, _) = tuple;
196
println!("Tuple is: {:?}", tuple);
197
```
198
199
-In a similar fashion to `_`, you can use `..` in a pattern to disregard
200
-multiple values:
+This also means that any temporary variables will be dropped at the end of the
+statement:
201
+
202
+```rust
203
+// Here, the String created will be dropped immediately, as it’s not bound:
204
205
+let _ = String::from(" hello ").trim();
206
+```
207
208
+You can also use `..` in a pattern to disregard multiple values:
209
210
```rust
211
enum OptionalTuple {
0 commit comments