From b498374e8c024cde2e2cc9579b7afc5ed20b9780 Mon Sep 17 00:00:00 2001 From: woofyzhao <490467089@qq.com> Date: Sun, 5 Feb 2023 19:55:40 +0800 Subject: [PATCH] remove redudant code --- src/error/option_unwrap/and_then.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/error/option_unwrap/and_then.md b/src/error/option_unwrap/and_then.md index c065f2043e..42a1f3ec08 100644 --- a/src/error/option_unwrap/and_then.md +++ b/src/error/option_unwrap/and_then.md @@ -39,10 +39,7 @@ fn have_recipe(food: Food) -> Option { fn cookable_v1(food: Food) -> Option { match have_recipe(food) { None => None, - Some(food) => match have_ingredients(food) { - None => None, - Some(food) => Some(food), - }, + Some(food) => have_ingredients(food), } }