Skip to content

Commit 05eed5f

Browse files
author
Jamil Maqdis Anton
committed
Refactor some variable names to help readability
1 parent 6f37cd0 commit 05eed5f

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/Async.fs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ module Async =
77
let map f m = async.Bind(m, (f >> async.Return))
88

99
let awaitTaskWithInnerException (task: Task<'T>): Async<'T> =
10-
Async.FromContinuations(fun (suc, exn, _cln) ->
10+
Async.FromContinuations(fun (success, exception', _cancellationToken) ->
1111
task.ContinueWith(fun (t: Task<'T>) ->
12-
if t.IsFaulted
13-
then if t.Exception.InnerExceptions.Count = 1 then
14-
exn t.Exception.InnerExceptions.[0]
15-
else
16-
exn t.Exception
17-
elif t.IsCanceled
18-
then exn (TaskCanceledException())
19-
else suc t.Result)
12+
if t.IsFaulted then
13+
if t.Exception.InnerExceptions.Count = 1
14+
then exception' t.Exception.InnerExceptions.[0]
15+
else exception' t.Exception
16+
elif t.IsCanceled then
17+
exception' (TaskCanceledException())
18+
else
19+
success t.Result)
2020
|> ignore)
2121

2222
let awaitTaskWithInnerException' (task: Task): Async<unit> =
23-
Async.FromContinuations(fun (suc, exn, _cln) ->
23+
Async.FromContinuations(fun (success, exception', _cancellationToken) ->
2424
task.ContinueWith(fun (t: Task) ->
25-
if t.IsFaulted
26-
then if t.Exception.InnerExceptions.Count = 1 then
27-
exn t.Exception.InnerExceptions.[0]
28-
else
29-
exn t.Exception
30-
elif t.IsCanceled
31-
then exn (TaskCanceledException())
32-
else suc ())
25+
if t.IsFaulted then
26+
if t.Exception.InnerExceptions.Count = 1
27+
then exception' t.Exception.InnerExceptions.[0]
28+
else exception' t.Exception
29+
elif t.IsCanceled then
30+
exception' (TaskCanceledException())
31+
else
32+
success ())
3333
|> ignore)

0 commit comments

Comments
 (0)