Skip to content

Commit 171efb5

Browse files
authored
Minor additional fixes
1 parent b60e3ef commit 171efb5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/patterns.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,16 @@ let x = String::from("Hello");
309309
let _ = x;
310310

311311
let y = (10, String::from("World"));
312+
// ignore a field from a tuple
312313
let (a, _) = y;
313314

314315
println!("{} {}", x, y.1); //x and y.1 were NOT moved
315316
# assert_eq!(a, 10);
316317

317-
struct Person {
318-
name: String,
319-
age: u8,
320-
}
318+
# struct Person {
319+
# name: String,
320+
# age: u8,
321+
# }
321322
let person = Person {
322323
name: String::from("John"),
323324
age: 23,

0 commit comments

Comments
 (0)