From 17b431d1884fa70f60c4b3b3da76d2174e6914d3 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Thu, 15 Feb 2024 16:41:21 +0100 Subject: [PATCH] match match match match match match match match match match --- members/matchmatchmatch/src/main.rs | 43 ++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/members/matchmatchmatch/src/main.rs b/members/matchmatchmatch/src/main.rs index 2b38896..ae14c50 100644 --- a/members/matchmatchmatch/src/main.rs +++ b/members/matchmatchmatch/src/main.rs @@ -1,16 +1,33 @@ fn main() { - let deep_type = Option::Some(Option::Some(Option::Some(()))); - match deep_type { - Some(inner) => match inner { - Some(inner) => match inner { - Some(inner) => { - println!("{:?}", inner); return; - } - None => {} - }, - None => {} - }, - None => {} + let deep_type = Option::Some(Option::Some(Option::Some(Option::Some(Option::Some( + Option::Some(Option::Some(Option::Some(1337))), + ))))); + match match match match match match match match deep_type { + Some(inner) => inner, + None => unreachable!(), + } { + Some(inner) => inner, + None => unreachable!(), + } { + Some(inner) => inner, + None => unreachable!(), + } { + Some(inner) => inner, + None => unreachable!(), + } { + Some(inner) => inner, + None => unreachable!(), + } { + Some(inner) => inner, + None => unreachable!(), + } { + Some(inner) => inner, + None => unreachable!(), + } { + Some(inner) => { + println!("{:?}", inner); + return; + } + None => unreachable!(), } - unreachable!() }