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

urllib: rem underscore methods from; add strings index_bytes

This commit is contained in:
joe-conigliaro
2019-10-11 04:04:11 +11:00
committed by Alexander Medvednikov
parent f3abb9e682
commit f8fefd5a60
6 changed files with 74 additions and 63 deletions

View File

@ -4,16 +4,12 @@
module urllib
struct ValueStruct {
struct Value {
pub:
mut:
data []string
}
// using this instead of just ValueStruct
// because of unknown map initializer bug
type Value ValueStruct
struct Values {
pub:
mut:
@ -41,7 +37,7 @@ pub fn (v &Value) all() []string {
// get gets the first value associated with the given key.
// If there are no values associated with the key, get returns
// a empty string.
pub fn (v Values) get(key string) string {
pub fn (v &Values) get(key string) string {
if v.data.size == 0 {
return ''
}
@ -55,7 +51,7 @@ pub fn (v Values) get(key string) string {
// get_all gets the all the values associated with the given key.
// If there are no values associated with the key, get returns
// a empty []string.
pub fn (v Values) get_all(key string) []string {
pub fn (v &Values) get_all(key string) []string {
if v.data.size == 0 {
return []string
}