From dcc8310bd0a7aa1f83ea9f6341faefc843173b28 Mon Sep 17 00:00:00 2001 From: Larpon Date: Wed, 6 Jan 2021 19:02:04 +0100 Subject: [PATCH] builtin: fix comment examples in int.v (#7902) --- vlib/builtin/int.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vlib/builtin/int.v b/vlib/builtin/int.v index 9a7f479824..fbf0cef618 100644 --- a/vlib/builtin/int.v +++ b/vlib/builtin/int.v @@ -439,11 +439,13 @@ pub fn (nn voidptr) hex_full() string { return u64_to_hex(nn, 16) } pub fn (nn byteptr) hex_full() string { return u64_to_hex(nn, 16) } */ // str returns the contents of `byte` as a zero terminated `string`. -// Example: assert byte(111).str() == 'o' +// Example: assert byte(111).str() == '111' pub fn (b byte) str() string { return int(b).str_l(7) } +// ascii_str returns the contents of `byte` as a zero terminated ASCII `string` character. +// Example: assert byte(97).ascii_str() == 'a' pub fn (b byte) ascii_str() string { mut str := string{ str: malloc(2)