@@ -8,20 +8,20 @@ namespace Open.ChannelExtensions
88{
99 public static partial class Extensions
1010 {
11- class TransformingChannelReader < TIn , TOut > : ChannelReader < TOut >
11+ class TransformingChannelReader < T , TResult > : ChannelReader < TResult >
1212 {
13- public TransformingChannelReader ( ChannelReader < TIn > source , Func < TIn , TOut > transform )
13+ public TransformingChannelReader ( ChannelReader < T > source , Func < T , TResult > transform )
1414 {
1515 _source = source ?? throw new ArgumentNullException ( nameof ( source ) ) ;
1616 _transform = transform ?? throw new ArgumentNullException ( nameof ( transform ) ) ;
1717 Contract . EndContractBlock ( ) ;
1818 }
1919
20- private readonly ChannelReader < TIn > _source ;
21- private readonly Func < TIn , TOut > _transform ;
20+ private readonly ChannelReader < T > _source ;
21+ private readonly Func < T , TResult > _transform ;
2222 public override Task Completion => _source . Completion ;
2323
24- public override bool TryRead ( out TOut item )
24+ public override bool TryRead ( out TResult item )
2525 {
2626 if ( _source . TryRead ( out var e ) )
2727 {
@@ -33,7 +33,7 @@ public override bool TryRead(out TOut item)
3333 return false ;
3434 }
3535
36- public override async ValueTask < TOut > ReadAsync ( CancellationToken cancellationToken = default )
36+ public override async ValueTask < TResult > ReadAsync ( CancellationToken cancellationToken = default )
3737 => _transform ( await _source . ReadAsync ( cancellationToken ) ) ;
3838
3939 public override ValueTask < bool > WaitToReadAsync ( CancellationToken cancellationToken = default )
@@ -43,12 +43,12 @@ public override ValueTask<bool> WaitToReadAsync(CancellationToken cancellationTo
4343 /// <summary>
4444 /// Transforms the
4545 /// </summary>
46- /// <typeparam name="TIn ">The output type of the provided source reader and input type of the transform.</typeparam>
47- /// <typeparam name="TOut ">The output type of the transform.</typeparam>
46+ /// <typeparam name="T ">The output type of the provided source reader and input type of the transform.</typeparam>
47+ /// <typeparam name="TResult ">The output type of the transform.</typeparam>
4848 /// <param name="source">The source channel reader.</param>
4949 /// <param name="transform">The transform function.</param>
5050 /// <returns>A channel reader representing the tranformed results.</returns>
51- public static ChannelReader < TOut > Transform < TIn , TOut > ( this ChannelReader < TIn > source , Func < TIn , TOut > transform )
52- => new TransformingChannelReader < TIn , TOut > ( source , transform ) ;
51+ public static ChannelReader < TResult > Transform < T , TResult > ( this ChannelReader < T > source , Func < T , TResult > transform )
52+ => new TransformingChannelReader < T , TResult > ( source , transform ) ;
5353 }
5454}
0 commit comments