examples: fix maps warnings

pull/1629/head
unknown-v 2019-08-17 01:55:11 +02:00 committed by Alexander Medvednikov
parent be141d9c5f
commit 49205dcce3
4 changed files with 8 additions and 8 deletions

View File

@ -17,7 +17,7 @@ fn main() {
println('failed to open $path') println('failed to open $path')
return return
} }
mut m := map[string]int{} mut m := map[string]int
for word in contents.to_lower().split(' ') { for word in contents.to_lower().split(' ') {
key := filter_word(word) key := filter_word(word)
if key == '' { if key == '' {

View File

@ -61,7 +61,7 @@ pub fn new_request(typ, _url, _data string) ?Request {
data: data data: data
ws_func: 0 ws_func: 0
user_ptr: 0 user_ptr: 0
headers: map[string]string{} headers: map[string]string
} }
} }
@ -112,7 +112,7 @@ pub fn (req &Request) do() Response {
} }
fn parse_response(resp string) Response { fn parse_response(resp string) Response {
mut headers := map[string]string{} mut headers := map[string]string
first_header := resp.all_before('\n') first_header := resp.all_before('\n')
mut status_code := 0 mut status_code := 0
if first_header.contains('HTTP/') { if first_header.contains('HTTP/') {

View File

@ -27,7 +27,7 @@ mut:
// values.encode() will return the encoded data // values.encode() will return the encoded data
pub fn new_values() Values { pub fn new_values() Values {
return Values{ return Values{
data: map[string]Value{} data: map[string]Value
} }
} }

View File

@ -119,7 +119,7 @@ pub fn run<T>(port int) {
action = 'index' action = 'index'
} }
req := http.Request{ req := http.Request{
headers: map[string]string{} headers: map[string]string
headers2: headers headers2: headers
ws_func: 0 ws_func: 0
user_ptr: 0 user_ptr: 0
@ -131,9 +131,9 @@ pub fn run<T>(port int) {
app.vweb = Context{ app.vweb = Context{
req: req req: req
conn: conn conn: conn
form: map[string]string{} form: map[string]string
static_files: map[string]string{} static_files: map[string]string
static_mime_types: map[string]string{} static_mime_types: map[string]string
} }
//} //}
if req.method in methods_with_form { if req.method in methods_with_form {