File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -28,18 +28,19 @@ There are many ways to create an `Option` instance - use whichever appeals to yo
2828``` csharp
2929Option < int > ex1 = Option .Some (42 );
3030Option < int > ex2 = 42 .Some ();
31- Option < int > ex3 = Option <int >.None ;
32- Option < int > ex4 = Option .None <int >();
33- Option < int > ex5 = default ; // equivalent to Option.None<int>()
31+ Option < int > ex3 = new Option <int >(42 );
32+ Option < int > ex4 = Option <int >.None ;
33+ Option < int > ex5 = Option .None <int >();
34+ Option < int > ex6 = default ; // equivalent to Option.None<int>()
3435
3536int ? maybeNull = GetPossiblyNullInteger ();
36- Option < int > ex5 = Option .Create (maybeNull ); // null turns into Option.None
37+ Option < int > ex7 = Option .Create (maybeNull ); // null turns into Option.None
3738
3839// Or you can use 'using static' for more concise/F#/Rust-like syntax:
3940using static RustyOptions .Option ;
4041
41- var ex6 = Some (42 );
42- var ex7 = None <int >();
42+ var ex8 = Some (42 );
43+ var ex9 = None <int >();
4344```
4445
4546### Getting values from an Option
You can’t perform that action at this time.
0 commit comments