From 9eb79ed6fdfccdbc6e9059e36c7694f4423b2b26 Mon Sep 17 00:00:00 2001 From: ivx <57248090+files-systems@users.noreply.github.com> Date: Sun, 15 Nov 2020 11:56:20 +0800 Subject: [PATCH] unwrap_or_(&0) -> unwrap_or(&0) unwrap_or_(&0) -> unwrap_or(&0) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0517ca7..777ed12 100644 --- a/README.md +++ b/README.md @@ -5902,7 +5902,7 @@ This closure takes `number_one` and `number_two`. We also gave it a new variable Usually you see closures in Rust inside of a method, because it is very convenient to have a closure inside. We saw closures in the last section with `.map()` and `.for_each()`. In that section we wrote `|x|` to bring in the next item in an iterator, and that was a closure. -Here is another example: the `unwrap_or` method that we know that you can use to give a value if `unwrap` doesn't work. Before, we wrote: `let fourth = my_vec.get(3).unwrap_or_(&0);`. But there is also an `unwrap_or_else` method that has a closure inside. So you can do this: +Here is another example: the `unwrap_or` method that we know that you can use to give a value if `unwrap` doesn't work. Before, we wrote: `let fourth = my_vec.get(3).unwrap_or(&0);`. But there is also an `unwrap_or_else` method that has a closure inside. So you can do this: ```rust fn main() {