Skip to content

Commit baaf150

Browse files
committed
Rename AsAsyncEnumerable to ToAsyncEnumerable
1 parent 3b80584 commit baaf150

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

AdvancedSharpAdbClient.Tests/DeviceCommands/DeviceExtensionsTests.Async.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public async Task GetDirectoryAsyncListingTest()
165165
{
166166
Assert.Equal(remotePath, x.ArgAt<string>(0));
167167
Assert.Equal(default, x.ArgAt<CancellationToken>(1));
168-
return stats.AsAsyncEnumerable(x.ArgAt<CancellationToken>(1));
168+
return stats.ToAsyncEnumerable(x.ArgAt<CancellationToken>(1));
169169
});
170170

171171
Factories.SyncServiceFactory = (c, d) =>

AdvancedSharpAdbClient.Tests/Extensions/AdbClientExtensionsTests.Async.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public async Task ExecuteServerCommandAsyncTest()
5151
Assert.Equal(command, x.ArgAt<string>(1));
5252
Assert.Equal(encoding, x.ArgAt<Encoding>(2));
5353
Assert.Equal(default, x.ArgAt<CancellationToken>(3));
54-
return result.AsAsyncEnumerable(x.ArgAt<CancellationToken>(3));
54+
return result.ToAsyncEnumerable(x.ArgAt<CancellationToken>(3));
5555
});
5656
_ = client.ExecuteServerEnumerableAsync(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<IAdbSocket>(), Arg.Any<Encoding>(), Arg.Any<CancellationToken>())
5757
.Returns(x =>
@@ -61,7 +61,7 @@ public async Task ExecuteServerCommandAsyncTest()
6161
Assert.Equal(socket, x.ArgAt<IAdbSocket>(2));
6262
Assert.Equal(encoding, x.ArgAt<Encoding>(3));
6363
Assert.Equal(default, x.ArgAt<CancellationToken>(4));
64-
return result.AsAsyncEnumerable(x.ArgAt<CancellationToken>(4));
64+
return result.ToAsyncEnumerable(x.ArgAt<CancellationToken>(4));
6565
});
6666

6767
await client.ExecuteServerCommandAsync(target, command, receiver);
@@ -102,7 +102,7 @@ public async Task ExecuteRemoteCommandAsyncTest()
102102
Assert.Equal(device, x.ArgAt<DeviceData>(1));
103103
Assert.Equal(encoding, x.ArgAt<Encoding>(2));
104104
Assert.Equal(default, x.ArgAt<CancellationToken>(3));
105-
return result.AsAsyncEnumerable(x.ArgAt<CancellationToken>(3));
105+
return result.ToAsyncEnumerable(x.ArgAt<CancellationToken>(3));
106106
});
107107

108108
await client.ExecuteRemoteCommandAsync(command, device, receiver);

AdvancedSharpAdbClient/Interfaces/IAdbClient.Async.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public partial interface IAdbClient
238238
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
239239
/// <returns>A <see cref="IAsyncEnumerable{String}"/> of strings, each representing a line of output from the command.</returns>
240240
IAsyncEnumerable<string> ExecuteServerEnumerableAsync(string target, string command, Encoding encoding, CancellationToken cancellationToken) =>
241-
ExecuteServerEnumerable(target, command, encoding).AsAsyncEnumerable(cancellationToken);
241+
ExecuteServerEnumerable(target, command, encoding).ToAsyncEnumerable(cancellationToken);
242242

243243
/// <summary>
244244
/// Asynchronously executes a command on the adb server and returns the <see cref="IAsyncEnumerable{String}"/> output.
@@ -251,7 +251,7 @@ IAsyncEnumerable<string> ExecuteServerEnumerableAsync(string target, string comm
251251
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
252252
/// <returns>A <see cref="IAsyncEnumerable{String}"/> of strings, each representing a line of output from the command.</returns>
253253
IAsyncEnumerable<string> ExecuteServerEnumerableAsync(string target, string command, IAdbSocket socket, Encoding encoding, CancellationToken cancellationToken) =>
254-
ExecuteServerEnumerable(target, command, socket, encoding).AsAsyncEnumerable(cancellationToken);
254+
ExecuteServerEnumerable(target, command, socket, encoding).ToAsyncEnumerable(cancellationToken);
255255

256256
/// <summary>
257257
/// Asynchronously executes a command on the device and returns the <see cref="IAsyncEnumerable{String}"/> output.
@@ -262,7 +262,7 @@ IAsyncEnumerable<string> ExecuteServerEnumerableAsync(string target, string comm
262262
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
263263
/// <returns>A <see cref="IAsyncEnumerable{String}"/> of strings, each representing a line of output from the command.</returns>
264264
IAsyncEnumerable<string> ExecuteRemoteEnumerableAsync(string command, DeviceData device, Encoding encoding, CancellationToken cancellationToken) =>
265-
ExecuteRemoteEnumerable(command, device, encoding).AsAsyncEnumerable(cancellationToken);
265+
ExecuteRemoteEnumerable(command, device, encoding).ToAsyncEnumerable(cancellationToken);
266266

267267
/// <summary>
268268
/// Asynchronously runs the event log service on a device and returns it.
@@ -272,7 +272,7 @@ IAsyncEnumerable<string> ExecuteRemoteEnumerableAsync(string command, DeviceData
272272
/// <param name="logNames">Optionally, the names of the logs to receive.</param>
273273
/// <returns>A <see cref="IAsyncEnumerable{LogEntry}"/> which contains the log entries.</returns>
274274
IAsyncEnumerable<LogEntry> RunLogServiceAsync(DeviceData device, CancellationToken cancellationToken, params LogId[] logNames) =>
275-
RunLogService(device, logNames).AsAsyncEnumerable(cancellationToken);
275+
RunLogService(device, logNames).ToAsyncEnumerable(cancellationToken);
276276
#endif
277277

278278
/// <summary>

AdvancedSharpAdbClient/Interfaces/ISyncService.Async.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public partial interface ISyncService
5858
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the task.</param>
5959
/// <returns>An <see cref="IAsyncEnumerable{FileStatistics}"/> which returns for each child item of the directory, a <see cref="FileStatistics"/> object with information of the item.</returns>
6060
IAsyncEnumerable<FileStatistics> GetDirectoryAsyncListing(string remotePath, CancellationToken cancellationToken) =>
61-
GetDirectoryListingAsync(remotePath, cancellationToken).ContinueWith(x => x.Result as IEnumerable<FileStatistics>).AsAsyncEnumerable(cancellationToken);
61+
GetDirectoryListingAsync(remotePath, cancellationToken).ContinueWith(x => x.Result as IEnumerable<FileStatistics>).ToAsyncEnumerable(cancellationToken);
6262
#endif
6363

6464
/// <summary>

AdvancedSharpAdbClient/Polyfills/Extensions/EnumerableExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static Task<TSource[]> ToArrayAsync<TSource>(this IEnumerable<Task<TSourc
7777
/// <param name="source">The sequence to type as <see cref="IAsyncEnumerable{TSource}"/>.</param>
7878
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
7979
/// <returns>The input sequence typed as <see cref="IAsyncEnumerable{TSource}"/>.</returns>
80-
public static async IAsyncEnumerable<TSource> AsAsyncEnumerable<TSource>(this IEnumerable<TSource> source, [EnumeratorCancellation] CancellationToken cancellationToken = default)
80+
public static async IAsyncEnumerable<TSource> ToAsyncEnumerable<TSource>(this IEnumerable<TSource> source, [EnumeratorCancellation] CancellationToken cancellationToken = default)
8181
{
8282
using IEnumerator<TSource> enumerator = source.GetEnumerator();
8383
while (!cancellationToken.IsCancellationRequested && enumerator.MoveNext())
@@ -94,7 +94,7 @@ public static async IAsyncEnumerable<TSource> AsAsyncEnumerable<TSource>(this IE
9494
/// <param name="source">The sequence to type as <see cref="IAsyncEnumerable{TSource}"/>.</param>
9595
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
9696
/// <returns>The input sequence typed as <see cref="IAsyncEnumerable{TSource}"/>.</returns>
97-
public static async IAsyncEnumerable<TSource> AsAsyncEnumerable<TSource>(this Task<IEnumerable<TSource>> source, [EnumeratorCancellation] CancellationToken cancellationToken = default)
97+
public static async IAsyncEnumerable<TSource> ToAsyncEnumerable<TSource>(this Task<IEnumerable<TSource>> source, [EnumeratorCancellation] CancellationToken cancellationToken = default)
9898
{
9999
using IEnumerator<TSource> enumerator = await source.ContinueWith(x => x.Result.GetEnumerator()).ConfigureAwait(false);
100100
while (!cancellationToken.IsCancellationRequested && enumerator.MoveNext())

0 commit comments

Comments
 (0)