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