Skip to content

Commit b91a9a8

Browse files
authored
Merge pull request #223 from tiziano88/patch-1
Clarify slice patterns example
2 parents 7bc9b7a + 58830fc commit b91a9a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rust-2018/slice-patterns.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main() {
1515
greet(&["Alan"]);
1616
// output: Hey, there Alan! You seem to be alone.
1717
greet(&["Joan", "Hugh"]);
18-
// output: Hello, Joan and Hugh. Nice to see you are at least 2!
18+
// output: Hello, Joan and Hugh. Nice to see you are exactly 2!
1919
greet(&["John", "Peter", "Stewart"]);
2020
// output: Hey everyone, we seem to be 3 here today.
2121
}
@@ -25,7 +25,7 @@ fn greet(people: &[&str]) {
2525
[] => println!("Bummer, there's no one here :("),
2626
[only_one] => println!("Hey, there {}! You seem to be alone.", only_one),
2727
[first, second] => println!(
28-
"Hello, {} and {}. Nice to see you are at least 2!",
28+
"Hello, {} and {}. Nice to see you are exactly 2!",
2929
first, second
3030
),
3131
_ => println!("Hey everyone, we seem to be {} here today.", people.len()),
@@ -88,4 +88,4 @@ error[E0527]: pattern requires 4 elements but array has 3
8888
[the tracking issue]: https://github.com/rust-lang/rust/issues/23121
8989

9090
When it comes to slice patterns, more advanced forms are planned but
91-
have not been stabilized yet. To learn more, follow [the tracking issue].
91+
have not been stabilized yet. To learn more, follow [the tracking issue].

0 commit comments

Comments
 (0)