Skip to content

Commit 0ec98ef

Browse files
Update TryParse methods to use nullable PreciseNumber
Changed the output parameter type of the TryParse methods in the PreciseNumber class from PreciseNumber to nullable PreciseNumber?. This allows the methods to return null on parsing failure, improving clarity in error handling.
1 parent 2213820 commit 0ec98ef

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

PreciseNumber/PreciseNumber.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,15 +760,15 @@ public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatPro
760760
}
761761

762762
/// <inheritdoc/>
763-
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)][NotNullWhen(true)] out PreciseNumber result) =>
763+
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, [NotNullWhen(true)] out PreciseNumber? result) =>
764764
TryParse(s.AsSpan(), style, provider, out result);
765765

766766
/// <inheritdoc/>
767-
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)][NotNullWhen(true)] out PreciseNumber result) =>
767+
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [NotNullWhen(true)] out PreciseNumber? result) =>
768768
TryParse(s.AsSpan(), NumberStyles.Any, provider, out result);
769769

770770
/// <inheritdoc/>
771-
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, [MaybeNullWhen(false)][NotNullWhen(true)] out PreciseNumber result) =>
771+
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, [NotNullWhen(true)] out PreciseNumber? result) =>
772772
TryParse(s, NumberStyles.Any, provider, out result);
773773

774774
/// <inheritdoc/>

0 commit comments

Comments
 (0)