Skip to content

Commit

Permalink
housekeeping: Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
HMBSbige committed Aug 9, 2021
1 parent ef7b178 commit 5b11e04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Pipelines.Extensions/PipeReaderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static async ValueTask CopyToAsync(
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void CheckIsCanceled(this ReadResult result, CancellationToken cancellationToken = default)
public static void ThrowIfCanceled(this ReadResult result, CancellationToken cancellationToken = default)
{
if (!result.IsCanceled)
{
Expand All @@ -106,7 +106,7 @@ public static void CheckIsCanceled(this ReadResult result, CancellationToken can
public static async ValueTask<ReadResult> ReadAndCheckIsCanceledAsync(this PipeReader reader, CancellationToken cancellationToken = default)
{
var result = await reader.ReadAsync(cancellationToken);
result.CheckIsCanceled(cancellationToken);
result.ThrowIfCanceled(cancellationToken);
return result;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Pipelines.Extensions/PipeWriterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static async ValueTask<FlushResult> WriteAsync(this PipeWriter writer, Re
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void CheckIsCanceled(this FlushResult flushResult, CancellationToken cancellationToken = default)
public static void ThrowIfCanceled(this FlushResult flushResult, CancellationToken cancellationToken = default)
{
if (!flushResult.IsCanceled)
{
Expand All @@ -76,7 +76,7 @@ public static void CheckIsCanceled(this FlushResult flushResult, CancellationTok
public static async ValueTask<FlushResult> FlushAndCheckIsCanceledAsync(this PipeWriter writer, CancellationToken cancellationToken = default)
{
var flushResult = await writer.FlushAsync(cancellationToken);
flushResult.CheckIsCanceled(cancellationToken);
flushResult.ThrowIfCanceled(cancellationToken);
return flushResult;
}
}
Expand Down

0 comments on commit 5b11e04

Please sign in to comment.