Skip to content

Commit

Permalink
Use new and/or keywords preferred by formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCVanB committed Jan 30, 2025
1 parent 24e6ac3 commit 2ad0e55
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/stdin.roc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ take_number_bytes! = |{}|
bytes_read,
[],
|bytes, b|
if b >= '0' && b <= '9' then
if b >= '0' and b <= '9' then
List.append(bytes, b)
else
bytes,
Expand Down
8 changes: 4 additions & 4 deletions platform/Http.roc
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ send! = |request|

other_error_prefix = Str.to_utf8("OTHER ERROR\n")
if response.status == 408 && response.body == Str.to_utf8("Request Timeout") then
if response.status == 408 and response.body == Str.to_utf8("Request Timeout") then
Err(HttpErr(Timeout))
else if response.status == 500 && response.body == Str.to_utf8("Network Error") then
else if response.status == 500 and response.body == Str.to_utf8("Network Error") then
Err(HttpErr(NetworkError))
else if response.status == 500 && response.body == Str.to_utf8("Bad Body") then
else if response.status == 500 and response.body == Str.to_utf8("Bad Body") then
Err(HttpErr(BadBody))
else if response.status == 500 && List.starts_with(response.body, other_error_prefix) then
else if response.status == 500 and List.starts_with(response.body, other_error_prefix) then
Err(HttpErr(Other(List.drop_first(response.body, List.len(other_error_prefix)))))
else
Ok(response)
Expand Down
4 changes: 2 additions & 2 deletions platform/InternalDateTime.roc
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ seconds_with_padded_zeros = month_with_padded_zeros
is_leap_year : I128 -> Bool
is_leap_year = |year|
(year % 4 == 0)
&& # divided evenly by 4 unless...
and # divided evenly by 4 unless...
(
(year % 100 != 0)
|| # divided by 100 not a leap year
or # divided by 100 not a leap year
(year % 400 == 0) # expecpt when also divisible by 400
)

Expand Down
2 changes: 1 addition & 1 deletion platform/Sqlite.roc
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ internal_to_external_error = |{ code, message }|
# internal use only
code_from_i64 : I64 -> ErrCode
code_from_i64 = |code|
if code == 1 || code == 0 then
if code == 1 or code == 0 then
Error
else if code == 2 then
Internal
Expand Down
6 changes: 3 additions & 3 deletions platform/Url.roc
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ percent_encode = |input|
|output, byte|
# Spec for percent-encoding: https://www.ietf.org/rfc/rfc3986.txt
if
(byte >= 97 && byte <= 122) # lowercase ASCII
|| (byte >= 65 && byte <= 90) # uppercase ASCII
|| (byte >= 48 && byte <= 57) # digit
(byte >= 97 and byte <= 122) # lowercase ASCII
or (byte >= 65 and byte <= 90) # uppercase ASCII
or (byte >= 48 and byte <= 57) # digit
then
# This is the most common case: an unreserved character,
# which needs no encoding in a path
Expand Down

0 comments on commit 2ad0e55

Please sign in to comment.