From 564a1a964ce1eb5341724743d63d652064c7e3b8 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Sun, 5 Nov 2023 16:23:45 +0100 Subject: [PATCH] Deprecate `ValueTask.FromResult` in favor of `ValueTask.fromResult` --- src/FSharp.Control.TaskSeq/Utils.fs | 3 +++ src/FSharp.Control.TaskSeq/Utils.fsi | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/FSharp.Control.TaskSeq/Utils.fs b/src/FSharp.Control.TaskSeq/Utils.fs index 72deadb5..986880ec 100644 --- a/src/FSharp.Control.TaskSeq/Utils.fs +++ b/src/FSharp.Control.TaskSeq/Utils.fs @@ -25,6 +25,9 @@ module ValueTask = let True = ValueTask true /// Creates a ValueTask with the supplied result of the successful operation. + let inline fromResult (x: 'T) = ValueTask<'T> x + + [] let inline FromResult (x: 'T) = ValueTask<'T> x /// Creates a ValueTask with an IValueTaskSource representing the operation diff --git a/src/FSharp.Control.TaskSeq/Utils.fsi b/src/FSharp.Control.TaskSeq/Utils.fsi index 65e119d0..4aee1bca 100644 --- a/src/FSharp.Control.TaskSeq/Utils.fsi +++ b/src/FSharp.Control.TaskSeq/Utils.fsi @@ -20,6 +20,13 @@ module ValueTask = val True: ValueTask /// Creates a ValueTask with the supplied result of the successful operation. + val inline fromResult: x: 'T -> ValueTask<'T> + + /// + /// The function is deprecated since version 0.4.0, + /// please use in its stead. See . + /// + [] val inline FromResult: x: 'T -> ValueTask<'T> ///