mirror of
https://github.com/darkicewolf50/RustBrock.git
synced 2025-06-15 13:04:18 -06:00
finished ch 6.1
This commit is contained in:
parent
625def1f22
commit
fdbc82191c
@ -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
|
Loading…
x
Reference in New Issue
Block a user