From eebc8a9d7af7e3da48b875e63d5c58a908cba9f5 Mon Sep 17 00:00:00 2001 From: spaceface Date: Sun, 14 Mar 2021 11:11:52 +0100 Subject: [PATCH] builtin: cleanup option names (part 2) (#9294) --- vlib/builtin/option.v | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/vlib/builtin/option.v b/vlib/builtin/option.v index 4b9801b308..2bd54f85f5 100644 --- a/vlib/builtin/option.v +++ b/vlib/builtin/option.v @@ -16,11 +16,6 @@ pub: code int } -struct Option3 { - state byte - err IError = none__ -} - const none__ = IError(&None__{}) struct None__ { @@ -30,28 +25,6 @@ struct None__ { fn (_ None__) str() string { return 'none' } -fn opt_ok3(data voidptr, mut option Option3, size int) { - unsafe { - *option = Option3{} - // use err to get the end of Option3 and then memcpy into it - C.memcpy(byteptr(&option.err) + sizeof(IError), data, size) - } -} - -[inline] -pub fn error3(message string) IError { - return &Error{ - msg: message - } -} - -pub fn error_with_code3(message string, code int) IError { - return &Error { - msg: message - code: code - } -} - // error returns a default error instance containing the error given in `message`. // Example: `if ouch { return error('an error occurred') }` [inline]