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

fmt: single line ternary return (#8605)

This commit is contained in:
Lukas Neubert
2021-02-08 00:28:46 +01:00
committed by GitHub
parent 118ca1240e
commit 473cd1d416
13 changed files with 49 additions and 79 deletions

View File

@@ -353,11 +353,7 @@ fn html_highlight(code string, tb &table.Table) string {
} else {
tok.lit
}
return if typ in [.unone, .name] {
lit
} else {
'<span class="token $typ">$lit</span>'
}
return if typ in [.unone, .name] { lit } else { '<span class="token $typ">$lit</span>' }
}
mut s := scanner.new_scanner(code, .parse_comments, &pref.Preferences{})
mut tok := s.scan()