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