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

fmt: better function call wrapping inside ternary if branches (#8604)

* fmt: better funcation call wrap in singel line ifs

* tests

* format files
This commit is contained in:
Lukas Neubert
2021-02-06 21:46:52 +01:00
committed by GitHub
parent cf230644b6
commit db0fc8fbc9
4 changed files with 32 additions and 16 deletions

View File

@@ -228,8 +228,11 @@ pub fn (ctx &Context) get_cookie(key string) ?string { // TODO refactor
cookie_header = ' ' + cookie_header
// println('cookie_header="$cookie_header"')
// println(ctx.req.headers)
cookie := if cookie_header.contains(';') { cookie_header.find_between(' $key=', ';') } else { cookie_header.find_between(' $key=',
'\r') }
cookie := if cookie_header.contains(';') {
cookie_header.find_between(' $key=', ';')
} else {
cookie_header.find_between(' $key=', '\r')
}
if cookie != '' {
return cookie.trim_space()
}