Skip to content

Commit 213a6cc

Browse files
authored
Update README.md
1 parent afca138 commit 213a6cc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,19 @@ There are many ways to create an `Option` instance - use whichever appeals to yo
2828
```csharp
2929
Option<int> ex1 = Option.Some(42);
3030
Option<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
3536
int? 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:
3940
using 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

0 commit comments

Comments
 (0)