Skip to content

Commit c5846e7

Browse files
committed
Rename ReadAllLinesAsync -> ReadLinesAsync
1 parent 9983f05 commit c5846e7

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

CliWrap/PipeTarget.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ Encoding encoding
253253
);
254254

255255
await foreach (
256-
var line in reader.ReadAllLinesAsync(cancellationToken).ConfigureAwait(false)
256+
var line in reader.ReadLinesAsync(cancellationToken).ConfigureAwait(false)
257257
)
258258
{
259259
await handleLineAsync(line, cancellationToken).ConfigureAwait(false);

CliWrap/Utils/Extensions/TextReaderExtensions.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ internal static class TextReaderExtensions
99
{
1010
extension(TextReader reader)
1111
{
12-
public async IAsyncEnumerable<string> ReadAllLinesAsync(
12+
public async IAsyncEnumerable<string> ReadLinesAsync(
1313
[EnumeratorCancellation] CancellationToken cancellationToken = default
1414
)
1515
{
16-
while (true)
16+
while (await reader.ReadLineAsync(cancellationToken).ConfigureAwait(false) is { } line)
1717
{
18-
var line = await reader.ReadLineAsync(cancellationToken).ConfigureAwait(false);
19-
if (line is null)
20-
yield break;
21-
2218
yield return line;
2319
}
2420
}

0 commit comments

Comments
 (0)