1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: add .vstring_literal and .vstring_literal_with_len for converting read only strings like os.args

This commit is contained in:
Delyan Angelov
2021-03-23 22:10:11 +02:00
parent 026f8424c2
commit b7c01db1f9
2 changed files with 63 additions and 4 deletions

View File

@@ -75,7 +75,7 @@ fn init_os_args(argc int, argv &&byte) []string {
// mut args := []string{len:argc}
for i in 0 .. argc {
// args [i] = argv[i].vstring()
unsafe { args_ << byteptr(argv[i]).vstring() }
unsafe { args_ << byteptr(argv[i]).vstring_literal() }
}
return args_
}