Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit eec1af0

Browse files
committed
Delete stale TryFormat and {Try}Parse overloads (dotnet/coreclr#16746)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
1 parent a9e68bf commit eec1af0

File tree

3 files changed

+0
-50
lines changed

3 files changed

+0
-50
lines changed

src/Common/src/CoreLib/System/Byte.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,6 @@ public String ToString(String format, IFormatProvider provider)
192192
return Number.FormatInt32(m_value, format, provider);
193193
}
194194

195-
// TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures
196-
public bool TryFormat(Span<char> destination, out int charsWritten, string format, IFormatProvider provider) =>
197-
TryFormat(destination, out charsWritten, (ReadOnlySpan<char>)format, provider);
198-
199195
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider provider = null)
200196
{
201197
return Number.TryFormatInt32(m_value, format, provider, destination, out charsWritten);

src/Common/src/CoreLib/System/DateTime.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,13 +1141,6 @@ public static DateTime ParseExact(String s, String format, IFormatProvider provi
11411141
return (DateTimeParse.ParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style));
11421142
}
11431143

1144-
// TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures
1145-
public static DateTime ParseExact(ReadOnlySpan<char> s, string format, IFormatProvider provider, DateTimeStyles style)
1146-
{
1147-
if (format == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.format);
1148-
return ParseExact(s, (ReadOnlySpan<char>)format, provider, style);
1149-
}
1150-
11511144
public static DateTime ParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, IFormatProvider provider, DateTimeStyles style = DateTimeStyles.None)
11521145
{
11531146
DateTimeFormatInfo.ValidateStyles(style, nameof(style));
@@ -1300,10 +1293,6 @@ public String ToString(String format, IFormatProvider provider)
13001293
return DateTimeFormat.Format(this, format, DateTimeFormatInfo.GetInstance(provider));
13011294
}
13021295

1303-
// TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures
1304-
public bool TryFormat(Span<char> destination, out int charsWritten, string format, IFormatProvider provider) =>
1305-
TryFormat(destination, out charsWritten, (ReadOnlySpan<char>)format, provider);
1306-
13071296
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider provider = null) =>
13081297
DateTimeFormat.TryFormat(this, destination, out charsWritten, format, DateTimeFormatInfo.GetInstance(provider));
13091298

@@ -1359,18 +1348,6 @@ public static Boolean TryParseExact(String s, String format, IFormatProvider pro
13591348
return DateTimeParse.TryParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style, out result);
13601349
}
13611350

1362-
// TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures
1363-
public static bool TryParseExact(ReadOnlySpan<char> s, string format, IFormatProvider provider, DateTimeStyles style, out DateTime result)
1364-
{
1365-
if (format == null)
1366-
{
1367-
result = default;
1368-
return false;
1369-
}
1370-
1371-
return TryParseExact(s, (ReadOnlySpan<char>)format, provider, style, out result);
1372-
}
1373-
13741351
public static bool TryParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, IFormatProvider provider, DateTimeStyles style, out DateTime result)
13751352
{
13761353
DateTimeFormatInfo.ValidateStyles(style, nameof(style));

src/Common/src/CoreLib/System/DateTimeOffset.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -669,13 +669,6 @@ public static DateTimeOffset ParseExact(String input, String format, IFormatProv
669669
return new DateTimeOffset(dateResult.Ticks, offset);
670670
}
671671

672-
// TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures
673-
public static DateTimeOffset ParseExact(ReadOnlySpan<char> input, string format, IFormatProvider formatProvider, DateTimeStyles styles)
674-
{
675-
if (format == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.format);
676-
return ParseExact(input, (ReadOnlySpan<char>)format, formatProvider, styles);
677-
}
678-
679672
public static DateTimeOffset ParseExact(ReadOnlySpan<char> input, ReadOnlySpan<char> format, IFormatProvider formatProvider, DateTimeStyles styles = DateTimeStyles.None)
680673
{
681674
styles = ValidateStyles(styles, nameof(styles));
@@ -780,10 +773,6 @@ public String ToString(String format, IFormatProvider formatProvider)
780773
return DateTimeFormat.Format(ClockDateTime, format, DateTimeFormatInfo.GetInstance(formatProvider), Offset);
781774
}
782775

783-
// TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures
784-
public bool TryFormat(Span<char> destination, out int charsWritten, string format, IFormatProvider provider) =>
785-
TryFormat(destination, out charsWritten, (ReadOnlySpan<char>)format, provider);
786-
787776
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider formatProvider = null) =>
788777
DateTimeFormat.TryFormat(ClockDateTime, destination, out charsWritten, format, DateTimeFormatInfo.GetInstance(formatProvider), Offset);
789778

@@ -862,18 +851,6 @@ public static Boolean TryParseExact(String input, String format, IFormatProvider
862851
return parsed;
863852
}
864853

865-
// TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures
866-
public static bool TryParseExact(ReadOnlySpan<char> input, string format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result)
867-
{
868-
if (format == null)
869-
{
870-
result = default;
871-
return false;
872-
}
873-
874-
return TryParseExact(input, (ReadOnlySpan<char>)format, formatProvider, styles, out result);
875-
}
876-
877854
public static bool TryParseExact(
878855
ReadOnlySpan<char> input, ReadOnlySpan<char> format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result)
879856
{

0 commit comments

Comments
 (0)