File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,9 @@ enum Char_parse_state {
27
27
// Note, that this function is unsafe.
28
28
// In most cases, you are better off using V's string interpolation,
29
29
// when your format string is known at compile time.
30
- fn v_printf (str string , pt ...voidptr) {
31
- print (v_sprintf (str, ...pt))
30
+ [unsafe ]
31
+ pub fn v_printf (str string , pt ...voidptr) {
32
+ print (unsafe { v_sprintf (str, ...pt) })
32
33
}
33
34
34
35
// v_sprintf returns a sprintf-like formated `string`.
@@ -41,7 +42,7 @@ fn v_printf(str string, pt ...voidptr) {
41
42
// x := 3.141516
42
43
// assert strconv.v_sprintf('aaa %G', x) == 'aaa 3.141516'
43
44
// ```
44
- [direct_array_access; manualfree]
45
+ [direct_array_access; manualfree; unsafe ]
45
46
pub fn v_sprintf (str string , pt ...voidptr) string {
46
47
mut res := strings.new_builder (pt.len * 16 )
47
48
defer {
You can’t perform that action at this time.
0 commit comments