File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -91,25 +91,20 @@ public static class Result
9191 /// Initializes a new successful result.
9292 /// </summary>
9393 /// <param name="value">The value to be stored as result.</param>
94- public Result ( T value )
95- {
96- this . value = value ;
97- exception = null ;
98- }
94+ public Result ( T value ) => this . value = value ;
9995
10096 /// <summary>
10197 /// Initializes a new unsuccessful result.
10298 /// </summary>
10399 /// <param name="error">The exception representing error. Cannot be <see langword="null"/>.</param>
104100 public Result ( Exception error )
101+ : this ( ExceptionDispatchInfo . Capture ( error ) )
105102 {
106- exception = ExceptionDispatchInfo . Capture ( error ) ;
107- Unsafe . SkipInit ( out value ) ;
108103 }
109104
110105 private Result ( ExceptionDispatchInfo dispatchInfo )
111106 {
112- value = default ! ;
107+ Unsafe . SkipInit ( out value ) ;
113108 exception = dispatchInfo ;
114109 }
115110
You can’t perform that action at this time.
0 commit comments