1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: fix if cond break readability (#8132)

This commit is contained in:
Daniel Däschle
2021-01-16 02:12:17 +01:00
committed by GitHub
parent 2f7a66386e
commit 53941c4a0a
29 changed files with 272 additions and 133 deletions

View File

@@ -119,7 +119,8 @@ fn (mut ws Client) read_handshake_str() ?string {
msg[total_bytes_read] = buffer[0]
total_bytes_read++
if total_bytes_read > 5 && msg[total_bytes_read - 1] == `\n` && msg[total_bytes_read -
2] == `\r` && msg[total_bytes_read - 3] == `\n` && msg[total_bytes_read - 4] == `\r` {
2] == `\r` && msg[total_bytes_read - 3] == `\n` && msg[total_bytes_read - 4] == `\r`
{
break
}
}

View File

@@ -43,7 +43,8 @@ pub fn (mut ws Client) validate_frame(frame &Frame) ? {
return error('rsv cannot be other than 0, not negotiated')
}
if (int(frame.opcode) >= 3 && int(frame.opcode) <= 7) ||
(int(frame.opcode) >= 11 && int(frame.opcode) <= 15) {
(int(frame.opcode) >= 11 && int(frame.opcode) <= 15)
{
ws.close(1002, 'use of reserved opcode') ?
return error('use of reserved opcode')
}