From fdbc82191c43ce3f507894adf09f6541736076aa Mon Sep 17 00:00:00 2001 From: darkicewolf50 <darkicewolf50@gmail.com> Date: Tue, 7 Jan 2025 14:11:18 -0700 Subject: [PATCH] finished ch 6.1 --- data_types.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/data_types.md b/data_types.md index 357cdbd..4a6c71b 100644 --- a/data_types.md +++ b/data_types.md @@ -763,3 +763,10 @@ will have to check if it has a non-null value in the enum then convert it into a this eliminates the issue of it being assued that is it a non-null tpye by being forced to handle the null variant everywhere where the value isnt a Option<T> can be safely assumed to be a non null type + +[documentation for Option T](https://doc.rust-lang.org/std/option/enum.Option.html) + +This has lots of useful values attached to it + +in general you want code that only runs when you have some T and another code that runs when you have a None value +The match expression is a control flow construct that an handle this, it is suited for enums, it will run different code depending on the enum state/value that it has that code can then be used inside the mtaching value \ No newline at end of file