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

net.http: refactor the Response struct (#10922)

This commit is contained in:
Miccah
2021-07-24 12:47:45 -05:00
committed by GitHub
parent 3979e5c5ff
commit a0e27d3fd9
10 changed files with 242 additions and 160 deletions

View File

@@ -28,3 +28,13 @@ pub fn version_from_str(v string) Version {
else { Version.unknown }
}
}
// protos returns the version major and minor numbers
pub fn (v Version) protos() (int, int) {
match v {
.v1_1 { return 1, 1 }
.v2_0 { return 2, 0 }
.v1_0 { return 1, 0 }
.unknown { return 0, 0 }
}
}