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

cgen: make the default values for all enums, be their first listed entry, even if it was enum MyEnum { first = 999 second}, not just the defaul 0 (#18388)

This commit is contained in:
Felipe Pena
2023-06-11 15:57:36 -03:00
committed by GitHub
parent fc6726b2b1
commit 54eabcb242
3 changed files with 42 additions and 0 deletions

View File

@ -32,6 +32,7 @@ pub mut:
//
// See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details.
pub enum SameSite {
same_site_not_set
same_site_default_mode = 1
same_site_lax_mode
same_site_strict_mode
@ -162,6 +163,7 @@ pub fn (c &Cookie) str() string {
b.write_string('; Secure')
}
match c.same_site {
.same_site_not_set {}
.same_site_default_mode {
b.write_string('; SameSite')
}