Skip to content

Commit 96a2f77

Browse files
Cleanup and updates.
1 parent 35db259 commit 96a2f77

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

Open.ChannelExtensions/Extensions.Batch.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Open.ChannelExtensions
55
{
66
public static partial class Extensions
77
{
8-
8+
99

1010
/// <summary>
1111
/// Batches results into the batch size provided with a max capacity of batches.
@@ -17,6 +17,6 @@ public static partial class Extensions
1717
/// <param name="allowSynchronousContinuations">True can reduce the amount of scheduling and markedly improve performance, but may produce unexpected or even undesirable behavior.</param>
1818
/// <returns>A channel reader containing the batches.</returns>
1919
public static BatchingChannelReader<T> Batch<T>(this ChannelReader<T> source, int batchSize, bool singleReader = false, bool allowSynchronousContinuations = false)
20-
=> new BatchingChannelReader<T>(source ?? throw new ArgumentNullException(nameof(source)), batchSize, singleReader, allowSynchronousContinuations);
20+
=> new(source ?? throw new ArgumentNullException(nameof(source)), batchSize, singleReader, allowSynchronousContinuations);
2121
}
2222
}

Open.ChannelExtensions/Extensions.Transform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static ChannelReader<TResult> Transform<T, TResult>(this ChannelReader<T>
6161
/// <param name="transform">The transform function.</param>
6262
/// <returns>A channel reader representing the tranformed results.</returns>
6363
public static TransformChannel<TWrite, TRead, TResult> Transform<TWrite, TRead, TResult>(this Channel<TWrite, TRead> source, Func<TRead, TResult> transform)
64-
=> new TransformChannel<TWrite, TRead, TResult>(source, transform);
64+
=> new(source, transform);
6565

6666
/// <summary>
6767
/// Transforms the
@@ -72,6 +72,6 @@ public static TransformChannel<TWrite, TRead, TResult> Transform<TWrite, TRead,
7272
/// <param name="transform">The transform function.</param>
7373
/// <returns>A channel reader representing the tranformed results.</returns>
7474
public static TransformChannel<T, TResult> Transform<T, TResult>(this Channel<T> source, Func<T, TResult> transform)
75-
=> new TransformChannel<T, TResult>(source, transform);
75+
=> new(source, transform);
7676
}
7777
}

Open.ChannelExtensions/Open.ChannelExtensions.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0; netstandard2.1</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
6+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
67
<Nullable>enable</Nullable>
78
<Authors>electricessence</Authors>
89
<Description>A set of extensions for optimizing/simplifying System.Threading.Channels usage.
@@ -27,10 +28,6 @@ Part of the "Open" set of libraries.</Description>
2728
</PropertyGroup>
2829

2930
<ItemGroup>
30-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
31-
<PrivateAssets>all</PrivateAssets>
32-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
33-
</PackageReference>
3431
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
3532
</ItemGroup>
3633

0 commit comments

Comments
 (0)