Skip to content

Commit 5cd3994

Browse files
authored
Merge pull request #20 from repr-man/main
Remove parens that stop compiler spec from passing
2 parents 0bbf2af + cd10595 commit 5cd3994

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

spec/TCP.Spec.savi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
@env.err.print("[EchoClient] Failed to connect.")
9797

9898
| IO.Action.Read |
99-
if (@io.read_stream.bytes_ahead_of_marker >= b"Hello, World!".size) (
99+
if @io.read_stream.bytes_ahead_of_marker >= b"Hello, World!".size (
100100
bytes val = @io.read_stream.extract_all
101101
@env.err.print("[EchoClient] Received: \(Inspect[bytes])")
102102
@io.close

src/TCP.Engine.savi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
// If we failed to resolve any valid connection attempts, send the actor
3535
// a later IO action that will let it know that connection has failed.
36-
if (@_pending_connect_count == 0) (
36+
if @_pending_connect_count == 0 (
3737
actor.io_deferred_action(IO.Action.OpenFailed)
3838
)
3939

@@ -53,7 +53,7 @@
5353
:yields IO.Action
5454
// If we haven't adopted an event yet, and this one is ready to be adopted,
5555
// try to adopt it now, as we expect it is one of our pending connections.
56-
if (@io.is_waiting_to_open && event.is_writable) (
56+
if @io.is_waiting_to_open && event.is_writable (
5757
try (
5858
@_pending_connect_count -= 1
5959
@io.adopt_event!(event)
@@ -62,7 +62,7 @@
6262
// We failed to adopt it because it was a failed connection attempt.
6363
// If there are no more pending connection attempts, our last one has
6464
// failed and we have no choice but to admit final failure.
65-
if (@_pending_connect_count == 0) (
65+
if @_pending_connect_count == 0 (
6666
yield IO.Action.OpenFailed
6767
)
6868

@@ -98,7 +98,7 @@
9898
// If the underlying engine didn't want to handle this event, it means
9999
// this is likely a later connection attempt after we already had one.
100100
// If we have more connection attempts pending, we'll unsubscribe it.
101-
if (@_pending_connect_count > 0) (
101+
if @_pending_connect_count > 0 (
102102
@_pending_connect_count -= 1
103103
_FFI.pony_asio_event_unsubscribe(event.id)
104104
|
@@ -141,7 +141,7 @@
141141
while @io.is_readable (
142142
try (
143143
bytes_read = @read_stream.receive_from!(@io)
144-
if (bytes_read > 0) (yield None)
144+
if bytes_read > 0 (yield None)
145145
)
146146
)
147147

src/TCP.Listen.Engine.savi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@_listen_netaddr!.ip_address_with_port_number
2828

2929
:fun _listen_netaddr!
30-
error! if (@_fd == -1)
30+
error! if @_fd == -1
3131
_NetAddress._for_fd(@_fd)
3232

3333
:new (@_actor, ticket TCP.Listen.Ticket, @_limit = 0)
@@ -48,7 +48,7 @@
4848

4949
// TODO: Delegate much of the AsioEvent internals to an `IO.CoreEngine`.
5050
:fun ref react(event AsioEvent) @
51-
if (event.id === @_event_id) (
51+
if event.id === @_event_id (
5252
if event.is_readable (
5353
yield IO.Action.Read
5454
)
@@ -67,7 +67,7 @@
6767
|
6868
if @_closed.not (
6969
try (
70-
while (@_limit == 0 || @_count < @_limit) (
70+
while @_limit == 0 || @_count < @_limit (
7171
conn_fd = _FFI.pony_os_accept(@_event_id)
7272
case conn_fd == (
7373
| 0 | error! // EWOULDBLOCK, don't try again
@@ -83,12 +83,12 @@
8383
)
8484

8585
:fun ref deferred_action(action IO.Action)
86-
if (action == IO.Action.ClosedChild) (
86+
if action == IO.Action.ClosedChild (
8787
@_count -= 1
8888

8989
// If releasing this connection takes us below the limit,
9090
// unpause acceptance and try to accept more connections.
91-
if (@_paused && @_count < @_limit) (
91+
if @_paused && @_count < @_limit (
9292
@_paused = False
9393
yield IO.Action.Read
9494
)
@@ -98,7 +98,7 @@
9898
@
9999

100100
:fun ref close
101-
if (@_closed.not && @_event_id.is_not_null) (
101+
if @_closed.not && @_event_id.is_not_null (
102102
// When not on windows, unsubscribe immediately here instead of later.
103103
if Platform.is_windows.not _FFI.pony_asio_event_unsubscribe(@_event_id)
104104

0 commit comments

Comments
 (0)