diff --git a/FrameworkFeatureConstants.props b/FrameworkFeatureConstants.props index 0d2c1254..e230adb0 100644 --- a/FrameworkFeatureConstants.props +++ b/FrameworkFeatureConstants.props @@ -13,9 +13,9 @@ $(DefineConstants);STACK_TRACE_HIDDEN_SUPPORTED;DATE_ONLY_SUPPORTED;TIME_ONLY_SUPPORTED;PRIORITY_QUEUE;TRY_GET_NON_ENUMERATED_COUNT;HTTP_HEADERS_NON_VALIDATED;ELEMENT_AT_INDEX - $(DefineConstants);GENERIC_MATH;GENERIC_PARSEABLE + $(DefineConstants);GENERIC_MATH;GENERIC_PARSABLE - $(DefineConstants);RANDOM_SHUFFLE;UTF8_SPAN_PARSEABLE + $(DefineConstants);RANDOM_SHUFFLE;UTF8_SPAN_PARSABLE diff --git a/Funcky.Test/Extensions/ParseExtensions/ParseExtensionsTest.Generic.cs b/Funcky.Test/Extensions/ParseExtensions/ParseExtensionsTest.Generic.cs index d6277843..13e98394 100644 --- a/Funcky.Test/Extensions/ParseExtensions/ParseExtensionsTest.Generic.cs +++ b/Funcky.Test/Extensions/ParseExtensions/ParseExtensionsTest.Generic.cs @@ -1,4 +1,4 @@ -#if GENERIC_PARSEABLE +#if GENERIC_PARSABLE using System.Globalization; namespace Funcky.Test.Extensions.ParseExtensions; @@ -6,7 +6,7 @@ namespace Funcky.Test.Extensions.ParseExtensions; public sealed partial class ParseExtensionsTest { [Theory] - [MemberData(nameof(ParseableDoubleNumbers))] + [MemberData(nameof(ParsableDoubleNumbers))] public void ParseGenericStringReturnsTheExpectedDouble(Option expected, string input) { Assert.Equal(expected, input.ParseNumberOrNone(NumberStyles.Number, null)); @@ -14,14 +14,14 @@ public void ParseGenericStringReturnsTheExpectedDouble(Option expected, } [Theory] - [MemberData(nameof(ParseableDoubleNumbers))] + [MemberData(nameof(ParsableDoubleNumbers))] public void ParseGenericSpanReturnsTheExpectedDouble(Option expected, string input) { Assert.Equal(expected, input.AsSpan().ParseNumberOrNone(NumberStyles.Number, null)); Assert.Equal(expected, input.AsSpan().ParseOrNone(null)); } - public static TheoryData, string> ParseableDoubleNumbers() + public static TheoryData, string> ParsableDoubleNumbers() => new() { { Option.Some(1.0), "1.0" }, diff --git a/Funcky/Extensions/ParseExtensions/ParseExtensions.GenericParseable.cs b/Funcky/Extensions/ParseExtensions/ParseExtensions.GenericParseable.cs index 63a370da..7ddfc44f 100644 --- a/Funcky/Extensions/ParseExtensions/ParseExtensions.GenericParseable.cs +++ b/Funcky/Extensions/ParseExtensions/ParseExtensions.GenericParseable.cs @@ -2,25 +2,25 @@ namespace Funcky.Extensions; public static partial class ParseExtensions { -#if GENERIC_PARSEABLE - public static Option ParseOrNone(this ReadOnlySpan value, IFormatProvider? provider) - where TParseable : ISpanParsable - => TParseable.TryParse(value, provider, out var result) +#if GENERIC_PARSABLE + public static Option ParseOrNone(this ReadOnlySpan value, IFormatProvider? provider) + where TParsable : ISpanParsable + => TParsable.TryParse(value, provider, out var result) ? result - : Option.None; + : Option.None; - public static Option ParseOrNone(this string? value, IFormatProvider? provider) - where TParseable : IParsable - => TParseable.TryParse(value, provider, out var result) + public static Option ParseOrNone(this string? value, IFormatProvider? provider) + where TParsable : IParsable + => TParsable.TryParse(value, provider, out var result) ? result - : Option.None; + : Option.None; #endif -#if UTF8_SPAN_PARSEABLE - public static Option ParseOrNone(this ReadOnlySpan utf8Text, IFormatProvider? provider) - where TParseable : IUtf8SpanParsable - => TParseable.TryParse(utf8Text, provider, out var result) +#if UTF8_SPAN_PARSABLE + public static Option ParseOrNone(this ReadOnlySpan utf8Text, IFormatProvider? provider) + where TParsable : IUtf8SpanParsable + => TParsable.TryParse(utf8Text, provider, out var result) ? result - : Option.None; + : Option.None; #endif } diff --git a/Funcky/PublicAPI.Unshipped.txt b/Funcky/PublicAPI.Unshipped.txt index 7c28104c..f452730f 100644 --- a/Funcky/PublicAPI.Unshipped.txt +++ b/Funcky/PublicAPI.Unshipped.txt @@ -31,9 +31,9 @@ static Funcky.Extensions.ParseExtensions.ParseInt64OrNone(this System.ReadOnlySp static Funcky.Extensions.ParseExtensions.ParseInt64OrNone(this System.ReadOnlySpan candidate) -> Funcky.Monads.Option static Funcky.Extensions.ParseExtensions.ParseNumberOrNone(this string! value, System.Globalization.NumberStyles style, System.IFormatProvider? provider) -> Funcky.Monads.Option static Funcky.Extensions.ParseExtensions.ParseNumberOrNone(this System.ReadOnlySpan value, System.Globalization.NumberStyles style, System.IFormatProvider? provider) -> Funcky.Monads.Option -static Funcky.Extensions.ParseExtensions.ParseOrNone(this string? value, System.IFormatProvider? provider) -> Funcky.Monads.Option -static Funcky.Extensions.ParseExtensions.ParseOrNone(this System.ReadOnlySpan value, System.IFormatProvider? provider) -> Funcky.Monads.Option -static Funcky.Extensions.ParseExtensions.ParseOrNone(this System.ReadOnlySpan utf8Text, System.IFormatProvider? provider) -> Funcky.Monads.Option +static Funcky.Extensions.ParseExtensions.ParseOrNone(this string? value, System.IFormatProvider? provider) -> Funcky.Monads.Option +static Funcky.Extensions.ParseExtensions.ParseOrNone(this System.ReadOnlySpan value, System.IFormatProvider? provider) -> Funcky.Monads.Option +static Funcky.Extensions.ParseExtensions.ParseOrNone(this System.ReadOnlySpan utf8Text, System.IFormatProvider? provider) -> Funcky.Monads.Option static Funcky.Extensions.ParseExtensions.ParseSByteOrNone(this System.ReadOnlySpan candidate, System.Globalization.NumberStyles style, System.IFormatProvider? provider) -> Funcky.Monads.Option static Funcky.Extensions.ParseExtensions.ParseSByteOrNone(this System.ReadOnlySpan candidate, System.IFormatProvider? provider) -> Funcky.Monads.Option static Funcky.Extensions.ParseExtensions.ParseSByteOrNone(this System.ReadOnlySpan candidate) -> Funcky.Monads.Option