finished ch 6.1

This commit is contained in:
darkicewolf50 2025-01-07 14:11:18 -07:00
parent 625def1f22
commit fdbc82191c

View File

@ -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