diff options
author | Stephen Toub <stoub@microsoft.com> | 2018-03-04 23:55:34 +0300 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2018-03-05 00:48:05 +0300 |
commit | 6cfeb78030f5e5d1a81875ee1e2cf1993d5102e1 (patch) | |
tree | 94afe1ca4cfe488b47e9c609377508ea74e9f096 | |
parent | f5e2a6bd005008fb4dca0a20e397430d4f0dabd4 (diff) |
Delete stale TryFormat and {Try}Parse overloads (dotnet/coreclr#16746)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Byte.cs | 4 | ||||
-rw-r--r-- | src/System.Private.CoreLib/shared/System/DateTime.cs | 23 | ||||
-rw-r--r-- | src/System.Private.CoreLib/shared/System/DateTimeOffset.cs | 23 |
3 files changed, 0 insertions, 50 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Byte.cs b/src/System.Private.CoreLib/shared/System/Byte.cs index 13ceb7573..31185f0ed 100644 --- a/src/System.Private.CoreLib/shared/System/Byte.cs +++ b/src/System.Private.CoreLib/shared/System/Byte.cs @@ -192,10 +192,6 @@ namespace System return Number.FormatInt32(m_value, format, provider); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public bool TryFormat(Span<char> destination, out int charsWritten, string format, IFormatProvider provider) => - TryFormat(destination, out charsWritten, (ReadOnlySpan<char>)format, provider); - public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider provider = null) { return Number.TryFormatInt32(m_value, format, provider, destination, out charsWritten); diff --git a/src/System.Private.CoreLib/shared/System/DateTime.cs b/src/System.Private.CoreLib/shared/System/DateTime.cs index b5deefa94..d3116ee25 100644 --- a/src/System.Private.CoreLib/shared/System/DateTime.cs +++ b/src/System.Private.CoreLib/shared/System/DateTime.cs @@ -1141,13 +1141,6 @@ namespace System return (DateTimeParse.ParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style)); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public static DateTime ParseExact(ReadOnlySpan<char> s, string format, IFormatProvider provider, DateTimeStyles style) - { - if (format == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.format); - return ParseExact(s, (ReadOnlySpan<char>)format, provider, style); - } - public static DateTime ParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, IFormatProvider provider, DateTimeStyles style = DateTimeStyles.None) { DateTimeFormatInfo.ValidateStyles(style, nameof(style)); @@ -1300,10 +1293,6 @@ namespace System return DateTimeFormat.Format(this, format, DateTimeFormatInfo.GetInstance(provider)); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public bool TryFormat(Span<char> destination, out int charsWritten, string format, IFormatProvider provider) => - TryFormat(destination, out charsWritten, (ReadOnlySpan<char>)format, provider); - public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider provider = null) => DateTimeFormat.TryFormat(this, destination, out charsWritten, format, DateTimeFormatInfo.GetInstance(provider)); @@ -1359,18 +1348,6 @@ namespace System return DateTimeParse.TryParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style, out result); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public static bool TryParseExact(ReadOnlySpan<char> s, string format, IFormatProvider provider, DateTimeStyles style, out DateTime result) - { - if (format == null) - { - result = default; - return false; - } - - return TryParseExact(s, (ReadOnlySpan<char>)format, provider, style, out result); - } - public static bool TryParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, IFormatProvider provider, DateTimeStyles style, out DateTime result) { DateTimeFormatInfo.ValidateStyles(style, nameof(style)); diff --git a/src/System.Private.CoreLib/shared/System/DateTimeOffset.cs b/src/System.Private.CoreLib/shared/System/DateTimeOffset.cs index bb2196348..1498f9365 100644 --- a/src/System.Private.CoreLib/shared/System/DateTimeOffset.cs +++ b/src/System.Private.CoreLib/shared/System/DateTimeOffset.cs @@ -669,13 +669,6 @@ namespace System return new DateTimeOffset(dateResult.Ticks, offset); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public static DateTimeOffset ParseExact(ReadOnlySpan<char> input, string format, IFormatProvider formatProvider, DateTimeStyles styles) - { - if (format == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.format); - return ParseExact(input, (ReadOnlySpan<char>)format, formatProvider, styles); - } - public static DateTimeOffset ParseExact(ReadOnlySpan<char> input, ReadOnlySpan<char> format, IFormatProvider formatProvider, DateTimeStyles styles = DateTimeStyles.None) { styles = ValidateStyles(styles, nameof(styles)); @@ -780,10 +773,6 @@ namespace System return DateTimeFormat.Format(ClockDateTime, format, DateTimeFormatInfo.GetInstance(formatProvider), Offset); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public bool TryFormat(Span<char> destination, out int charsWritten, string format, IFormatProvider provider) => - TryFormat(destination, out charsWritten, (ReadOnlySpan<char>)format, provider); - public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider formatProvider = null) => DateTimeFormat.TryFormat(ClockDateTime, destination, out charsWritten, format, DateTimeFormatInfo.GetInstance(formatProvider), Offset); @@ -862,18 +851,6 @@ namespace System return parsed; } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public static bool TryParseExact(ReadOnlySpan<char> input, string format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result) - { - if (format == null) - { - result = default; - return false; - } - - return TryParseExact(input, (ReadOnlySpan<char>)format, formatProvider, styles, out result); - } - public static bool TryParseExact( ReadOnlySpan<char> input, ReadOnlySpan<char> format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result) { |