diff --git a/examples/hot_reload/bounce.v b/examples/hot_reload/bounce.v index a2017b08e8..2c1c3ff5e3 100644 --- a/examples/hot_reload/bounce.v +++ b/examples/hot_reload/bounce.v @@ -9,7 +9,7 @@ import glfw import time struct Game { -mut: +mut: gg &gg.GG x int y int @@ -26,24 +26,24 @@ fn main() { width := 600 height := 300 mut game := &Game{ - gg: 0 - dx: 2 - dy: 2 - height: height - width: width + gg: 0 + dx: 2 + dy: 2 + height: height + width: width } - mut window := glfw.create_window(glfw.WinCfg { - width: width - height: height - borderless: false + window := glfw.create_window(glfw.WinCfg { + width: width + height: height + borderless: false title: 'Hot code reloading demo' - ptr: game - always_on_top: true - }) + ptr: game + always_on_top: true + }) //window.onkeydown(key_down) - game.main_wnd = window + game.main_wnd = window window.make_context_current() - gg.init_gg() + gg.init_gg() game.gg = gg.new_context(gg.Cfg { width: width height: height @@ -67,7 +67,7 @@ const ( [live] fn (game &Game) draw() { - game.gg.draw_rect(game.x, game.y, width, width, gx.rgb(255, 0, 0)) + game.gg.draw_rect(game.x, game.y, width, width, gx.rgb(255, 0, 0)) } fn (game mut Game) run() { diff --git a/vlib/builtin/array_test.v b/vlib/builtin/array_test.v index b551cfd785..629963b2c0 100644 --- a/vlib/builtin/array_test.v +++ b/vlib/builtin/array_test.v @@ -262,8 +262,8 @@ fn test_push_many() { } fn test_reverse() { - mut a := [1, 2, 3, 4] - mut b := ['test', 'array', 'reverse'] + a := [1, 2, 3, 4] + b := ['test', 'array', 'reverse'] c := a.reverse() d := b.reverse() for i, _ in c { diff --git a/vlib/builtin/string_test.v b/vlib/builtin/string_test.v index dcf98255eb..27875907c6 100644 --- a/vlib/builtin/string_test.v +++ b/vlib/builtin/string_test.v @@ -172,7 +172,7 @@ fn test_replace() { assert b.replace('B', '') == 'onetwothree' b = '**char' assert b.replace('*char', 'byteptr') == '*byteptr' - mut c :='abc' + c :='abc' assert c.replace('','-') == c } @@ -403,7 +403,7 @@ fn test_capitalize() { } fn test_title() { - mut s := 'hello world' + s := 'hello world' assert s.title() == 'Hello World' s.to_upper() assert s.title() == 'Hello World' @@ -500,6 +500,7 @@ fn test_atoi() { fn test_raw_inter() { world := 'world' + println(world) s := r'hello\n$world' assert s == r'hello\n$world' assert s.contains('$') diff --git a/vlib/math/complex/complex_test.v b/vlib/math/complex/complex_test.v index 1cc26abb45..42c70a641d 100644 --- a/vlib/math/complex/complex_test.v +++ b/vlib/math/complex/complex_test.v @@ -134,7 +134,7 @@ fn test_complex_angle(){ assert (c.angle() * 180 / math.pi).eq(135) c = cmplx.complex(-1, -1) assert (c.angle() * 180 / math.pi).eq(-135) - mut cc := c.conjugate() + cc := c.conjugate() assert (cc.angle() + c.angle()).eq(0) } diff --git a/vlib/math/fractions/fraction_test.v b/vlib/math/fractions/fraction_test.v index dda5250664..28a8a961f0 100644 --- a/vlib/math/fractions/fraction_test.v +++ b/vlib/math/fractions/fraction_test.v @@ -147,7 +147,7 @@ fn test_fraction_equals() { } fn test_gcd_and_reduce(){ - mut f := fractions.fraction(3, 9) + f := fractions.fraction(3, 9) assert f.gcd() == 3 - assert f.reduce().equals(fractions.fraction(1, 3)) + assert f.reduce().equals(fractions.fraction(1, 3)) } diff --git a/vlib/net/socket_test.v b/vlib/net/socket_test.v index a98b31ad3d..a3c7ce6025 100644 --- a/vlib/net/socket_test.v +++ b/vlib/net/socket_test.v @@ -1,14 +1,14 @@ import net fn test_socket() { - mut server := net.listen(0) or { + server := net.listen(0) or { panic(err) } server_port := server.get_port() - mut client := net.dial('127.0.0.1', server_port) or { + client := net.dial('127.0.0.1', server_port) or { panic(err) } - mut socket := server.accept() or { + socket := server.accept() or { panic(err) }