From 7ba5248e56e0233c5d9b1696b3edf02b1672d360 Mon Sep 17 00:00:00 2001 From: Nicolas Sauzede Date: Sun, 27 Oct 2019 07:36:40 +0100 Subject: [PATCH] os_win.v: switch => match --- vlib/os/os_windows.v | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/vlib/os/os_windows.v b/vlib/os/os_windows.v index 9b691f5d94..28b8e19505 100644 --- a/vlib/os/os_windows.v +++ b/vlib/os/os_windows.v @@ -126,13 +126,15 @@ pub fn get_module_filename(handle HANDLE) ?string { mut buf := &u16(malloc(4096)) for { status := C.GetModuleFileName(handle, &buf, sz) - switch status { - case SUCCESS: - _filename := string_from_wide2(buf, sz) - return _filename - default: - // Must handled with GetLastError and converted by FormatMessage - return error('Cannot get file name from handle') + match status { + SUCCESS { + _filename := string_from_wide2(buf, sz) + return _filename + } + else { + // Must handled with GetLastError and converted by FormatMessage + return error('Cannot get file name from handle') + } } } panic('this should be unreachable') // TODO remove unreachable after loop