Skip to content

Commit

Permalink
Remove obsolete "Concat" method
Browse files Browse the repository at this point in the history
This is a squashed merge of PR #1002 that closes #993.
  • Loading branch information
pflajszer authored Jun 24, 2023
1 parent bf8e270 commit 8db4bef
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
13 changes: 0 additions & 13 deletions MoreLinq/Append.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,5 @@ public static IEnumerable<T> Append<T>(this IEnumerable<T> head, T tail)
? node.Concat(tail)
: PendNode<T>.WithSource(head).Concat(tail);
}

/// <summary>
/// Returns a sequence consisting of the head elements and the given tail element.
/// </summary>
/// <typeparam name="T">Type of sequence</typeparam>
/// <param name="head">All elements of the head. Must not be null.</param>
/// <param name="tail">Tail element of the new sequence.</param>
/// <returns>A sequence consisting of the head elements and the given tail element.</returns>
/// <remarks>This operator uses deferred execution and streams its results.</remarks>

[Obsolete("Use " + nameof(Append) + " instead.")]
public static IEnumerable<T> Concat<T>(this IEnumerable<T> head, T tail) =>
head.Append(tail);
}
}
28 changes: 28 additions & 0 deletions MoreLinq/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:MoreLinq.MoreEnumerable.Concat``1(System.Collections.Generic.IEnumerable{``0},``0)</Target>
<Left>lib/net462/MoreLinq.dll</Left>
<Right>lib/netstandard2.0/MoreLinq.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:MoreLinq.MoreEnumerable.Concat``1(System.Collections.Generic.IEnumerable{``0},``0)</Target>
<Left>lib/net6.0/MoreLinq.dll</Left>
<Right>lib/net6.0/MoreLinq.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:MoreLinq.MoreEnumerable.Concat``1(System.Collections.Generic.IEnumerable{``0},``0)</Target>
<Left>lib/netstandard2.0/MoreLinq.dll</Left>
<Right>lib/netstandard2.0/MoreLinq.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:MoreLinq.MoreEnumerable.Concat``1(System.Collections.Generic.IEnumerable{``0},``0)</Target>
<Left>lib/netstandard2.1/MoreLinq.dll</Left>
<Right>lib/netstandard2.1/MoreLinq.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>PKV006</DiagnosticId>
<Target>.NETStandard,Version=v1.0</Target>
Expand Down
1 change: 1 addition & 0 deletions MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#nullable enable
*REMOVED*static MoreLinq.MoreEnumerable.Concat<T>(this System.Collections.Generic.IEnumerable<T>! head, T tail) -> System.Collections.Generic.IEnumerable<T>!
1 change: 1 addition & 0 deletions MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#nullable enable
*REMOVED*static MoreLinq.MoreEnumerable.Concat<T>(this System.Collections.Generic.IEnumerable<T>! head, T tail) -> System.Collections.Generic.IEnumerable<T>!
1 change: 1 addition & 0 deletions MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#nullable enable
*REMOVED*static MoreLinq.MoreEnumerable.Concat<T>(this System.Collections.Generic.IEnumerable<T>! head, T tail) -> System.Collections.Generic.IEnumerable<T>!
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,11 @@ first sequence has fewer, the same or more elements than the second sequence.

Returns a sequence consisting of the head element and the given tail elements.

This method is obsolete and will be removed in a future version. Use `Append`
instead.
This extension was rendered obsolete in version 3.0 and eventually removed in
version 4.0. Use [`Append`][linq-append] from .NET instead that's been available
since .NET Standard 1.6+, .NET Core 1.0+ and .NET Framework 4.7.1+.

[linq-append]: https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.append

### Consume

Expand Down

0 comments on commit 8db4bef

Please sign in to comment.