From 49205dcce38844ad3abcd508d0ad252fd04696eb Mon Sep 17 00:00:00 2001 From: unknown-v <52547845+unknown-v@users.noreply.github.com> Date: Sat, 17 Aug 2019 01:55:11 +0200 Subject: [PATCH] examples: fix maps warnings --- examples/word_counter/word_counter.v | 2 +- vlib/http/http.v | 4 ++-- vlib/net/urllib/values.v | 2 +- vlib/vweb/vweb.v | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/word_counter/word_counter.v b/examples/word_counter/word_counter.v index 82de0d4d61..26bdbd45eb 100644 --- a/examples/word_counter/word_counter.v +++ b/examples/word_counter/word_counter.v @@ -17,7 +17,7 @@ fn main() { println('failed to open $path') return } - mut m := map[string]int{} + mut m := map[string]int for word in contents.to_lower().split(' ') { key := filter_word(word) if key == '' { diff --git a/vlib/http/http.v b/vlib/http/http.v index e578c17688..69ca0b68c0 100644 --- a/vlib/http/http.v +++ b/vlib/http/http.v @@ -61,7 +61,7 @@ pub fn new_request(typ, _url, _data string) ?Request { data: data ws_func: 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 { - mut headers := map[string]string{} + mut headers := map[string]string first_header := resp.all_before('\n') mut status_code := 0 if first_header.contains('HTTP/') { diff --git a/vlib/net/urllib/values.v b/vlib/net/urllib/values.v index 10b1e4c636..a9684a7da5 100644 --- a/vlib/net/urllib/values.v +++ b/vlib/net/urllib/values.v @@ -27,7 +27,7 @@ mut: // values.encode() will return the encoded data pub fn new_values() Values { return Values{ - data: map[string]Value{} + data: map[string]Value } } diff --git a/vlib/vweb/vweb.v b/vlib/vweb/vweb.v index 064b1a84ed..e70b729742 100644 --- a/vlib/vweb/vweb.v +++ b/vlib/vweb/vweb.v @@ -119,7 +119,7 @@ pub fn run(port int) { action = 'index' } req := http.Request{ - headers: map[string]string{} + headers: map[string]string headers2: headers ws_func: 0 user_ptr: 0 @@ -131,9 +131,9 @@ pub fn run(port int) { app.vweb = Context{ req: req conn: conn - form: map[string]string{} - static_files: map[string]string{} - static_mime_types: map[string]string{} + form: map[string]string + static_files: map[string]string + static_mime_types: map[string]string } //} if req.method in methods_with_form {