Skip to content

Commit 2ad0e55

Browse files
committed
Use new and/or keywords preferred by formatter
1 parent 24e6ac3 commit 2ad0e55

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

examples/stdin.roc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ take_number_bytes! = |{}|
3030
bytes_read,
3131
[],
3232
|bytes, b|
33-
if b >= '0' && b <= '9' then
33+
if b >= '0' and b <= '9' then
3434
List.append(bytes, b)
3535
else
3636
bytes,

platform/Http.roc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ send! = |request|
7171

7272
other_error_prefix = Str.to_utf8("OTHER ERROR\n")
7373
74-
if response.status == 408 && response.body == Str.to_utf8("Request Timeout") then
74+
if response.status == 408 and response.body == Str.to_utf8("Request Timeout") then
7575
Err(HttpErr(Timeout))
76-
else if response.status == 500 && response.body == Str.to_utf8("Network Error") then
76+
else if response.status == 500 and response.body == Str.to_utf8("Network Error") then
7777
Err(HttpErr(NetworkError))
78-
else if response.status == 500 && response.body == Str.to_utf8("Bad Body") then
78+
else if response.status == 500 and response.body == Str.to_utf8("Bad Body") then
7979
Err(HttpErr(BadBody))
80-
else if response.status == 500 && List.starts_with(response.body, other_error_prefix) then
80+
else if response.status == 500 and List.starts_with(response.body, other_error_prefix) then
8181
Err(HttpErr(Other(List.drop_first(response.body, List.len(other_error_prefix)))))
8282
else
8383
Ok(response)

platform/InternalDateTime.roc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ seconds_with_padded_zeros = month_with_padded_zeros
5252
is_leap_year : I128 -> Bool
5353
is_leap_year = |year|
5454
(year % 4 == 0)
55-
&& # divided evenly by 4 unless...
55+
and # divided evenly by 4 unless...
5656
(
5757
(year % 100 != 0)
58-
|| # divided by 100 not a leap year
58+
or # divided by 100 not a leap year
5959
(year % 400 == 0) # expecpt when also divisible by 400
6060
)
6161

platform/Sqlite.roc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ internal_to_external_error = |{ code, message }|
670670
# internal use only
671671
code_from_i64 : I64 -> ErrCode
672672
code_from_i64 = |code|
673-
if code == 1 || code == 0 then
673+
if code == 1 or code == 0 then
674674
Error
675675
else if code == 2 then
676676
Internal

platform/Url.roc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ percent_encode = |input|
203203
|output, byte|
204204
# Spec for percent-encoding: https://www.ietf.org/rfc/rfc3986.txt
205205
if
206-
(byte >= 97 && byte <= 122) # lowercase ASCII
207-
|| (byte >= 65 && byte <= 90) # uppercase ASCII
208-
|| (byte >= 48 && byte <= 57) # digit
206+
(byte >= 97 and byte <= 122) # lowercase ASCII
207+
or (byte >= 65 and byte <= 90) # uppercase ASCII
208+
or (byte >= 48 and byte <= 57) # digit
209209
then
210210
# This is the most common case: an unreserved character,
211211
# which needs no encoding in a path

0 commit comments

Comments
 (0)