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

builtin: change IError msg and code to methods + fix vlib, add a deprecation notice for the old usages (#13041)

This commit is contained in:
Tim Basel
2022-02-11 14:52:33 +01:00
committed by GitHub
parent 61024d4b75
commit 9d0a5942ac
80 changed files with 493 additions and 324 deletions

View File

@@ -410,7 +410,7 @@ fn split_by_scheme(rawurl string) ?[]string {
}
fn get_scheme(rawurl string) ?string {
split := split_by_scheme(rawurl) or { return err.msg }
split := split_by_scheme(rawurl) or { return err.msg() }
return split[0]
}
@@ -593,9 +593,9 @@ fn parse_host(host string) ?string {
// We do impose some restrictions on the zone, to avoid stupidity
// like newlines.
if zone := host[..i].index('%25') {
host1 := unescape(host[..zone], .encode_host) or { return err.msg }
host2 := unescape(host[zone..i], .encode_zone) or { return err.msg }
host3 := unescape(host[i..], .encode_host) or { return err.msg }
host1 := unescape(host[..zone], .encode_host) or { return err.msg() }
host2 := unescape(host[zone..i], .encode_zone) or { return err.msg() }
host3 := unescape(host[i..], .encode_host) or { return err.msg() }
return host1 + host2 + host3
}
if idx := host.last_index(':') {
@@ -606,7 +606,7 @@ fn parse_host(host string) ?string {
}
}
}
h := unescape(host, .encode_host) or { return err.msg }
h := unescape(host, .encode_host) or { return err.msg() }
return h
// host = h
// return host