mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-02-12 04:39:19 +00:00
Merge 4708f8d4561ebd12d33d2e1791a53d5b3e9ac114 into 87ac600b7c050538b1622084ea7c356b8a1d02bc
This commit is contained in:
commit
1b861fe5df
@ -9,7 +9,8 @@ mod tests {
|
|||||||
let target = "rustlings";
|
let target = "rustlings";
|
||||||
let optional_target = Some(target);
|
let optional_target = Some(target);
|
||||||
|
|
||||||
// TODO: Make this an if-let statement whose value is `Some`.
|
// TODO: Complete this if-let statement by adding the missing keywords.
|
||||||
|
// The pattern should match oon 'Some'.
|
||||||
word = optional_target {
|
word = optional_target {
|
||||||
assert_eq!(word, target);
|
assert_eq!(word, target);
|
||||||
}
|
}
|
||||||
@ -26,9 +27,9 @@ mod tests {
|
|||||||
|
|
||||||
let mut cursor = range;
|
let mut cursor = range;
|
||||||
|
|
||||||
// TODO: Make this a while-let statement. Remember that `Vec::pop()`
|
// TODO: Complete this while-let statement by adding the missing keywords.
|
||||||
// adds another layer of `Option`. You can do nested pattern matching
|
// Remember that `Vec::pop()` adds another layer of `Option`.
|
||||||
// in if-let and while-let statements.
|
// You can do nested pattern matching in if-let and while-let statements.
|
||||||
integer = optional_integers.pop() {
|
integer = optional_integers.pop() {
|
||||||
assert_eq!(integer, cursor);
|
assert_eq!(integer, cursor);
|
||||||
cursor -= 1;
|
cursor -= 1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user