Skip to content

Commit

Permalink
[core] Move 'AsTask' to be actual methods, not extension methods
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcgovern committed Oct 29, 2019
1 parent 9723ccb commit 8fdef80
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 57 deletions.
9 changes: 9 additions & 0 deletions src/ReusableTasks/ReusableTasks/ReusableTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;

namespace ReusableTasks
{
Expand Down Expand Up @@ -74,6 +75,14 @@ internal ReusableTask (ReusableTaskMethodBuilder builder)
Result = new ResultHolder<EmptyStruct> ();
}

/// <summary>
/// Converts this <see cref="ReusableTask"/> into a standard
/// <see cref="System.Threading.Tasks.Task"/>
/// </summary>
/// <returns></returns>
public async Task AsTask ()
=> await this;

/// <summary>
/// Configures the awaiter used by this <see cref="ReusableTask{T}"/>
/// </summary>
Expand Down
57 changes: 0 additions & 57 deletions src/ReusableTasks/ReusableTasks/ReusableTaskExtensions.cs

This file was deleted.

9 changes: 9 additions & 0 deletions src/ReusableTasks/ReusableTasks/ReusableTask_T.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;

namespace ReusableTasks
{
Expand Down Expand Up @@ -61,6 +62,14 @@ internal ReusableTask (ReusableTaskMethodBuilder<T> builder)
Result = new ResultHolder<T> ();
}

/// <summary>
/// Converts this <see cref="ReusableTask"/> into a standard
/// <see cref="System.Threading.Tasks.Task"/>
/// </summary>
/// <returns></returns>
public async Task<T> AsTask ()
=> await this;

/// <summary>
/// Configures the awaiter used by this <see cref="ReusableTask{T}"/>
/// </summary>
Expand Down

0 comments on commit 8fdef80

Please sign in to comment.