Skip to content

Commit

Permalink
Deprecate ValueTask.FromResult in favor of ValueTask.fromResult
Browse files Browse the repository at this point in the history
  • Loading branch information
abelbraaksma committed Nov 5, 2023
1 parent cd4b7ab commit 564a1a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/FSharp.Control.TaskSeq/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ module ValueTask =
let True = ValueTask<bool> true

/// Creates a ValueTask with the supplied result of the successful operation.
let inline fromResult (x: 'T) = ValueTask<'T> x

[<Obsolete "From version 0.4.0 onward, 'ValueTask.FromResult' is deprecated in favor of 'ValueTask.fromResult'. It will be removed in an upcoming release.">]
let inline FromResult (x: 'T) = ValueTask<'T> x

/// Creates a ValueTask with an IValueTaskSource representing the operation
Expand Down
7 changes: 7 additions & 0 deletions src/FSharp.Control.TaskSeq/Utils.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ module ValueTask =
val True: ValueTask<bool>

/// Creates a ValueTask with the supplied result of the successful operation.
val inline fromResult: x: 'T -> ValueTask<'T>

/// <summary>
/// The function <paramref name="FromResult" /> is deprecated since version 0.4.0,
/// please use <paramref name="fromSource" /> in its stead. See <see cref="T:FSharp.Control.ValueTask.fromResult" />.
/// </summary>
[<Obsolete "From version 0.4.0 onward, 'ValueTask.FromResult' is deprecated in favor of 'ValueTask.fromResult'. It will be removed in an upcoming release.">]
val inline FromResult: x: 'T -> ValueTask<'T>

/// <summary>
Expand Down

0 comments on commit 564a1a9

Please sign in to comment.