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:
@@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user