summary refs log tree commit diff
path: root/src/rt/rust.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust.cpp')
-rw-r--r--src/rt/rust.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/rt/rust.cpp b/src/rt/rust.cpp
index b5af3942a20..dacbcee1045 100644
--- a/src/rt/rust.cpp
+++ b/src/rt/rust.cpp
@@ -41,16 +41,7 @@ command_line_args : public kernel_owned<command_line_args>
         LocalFree(wargv);
 #endif
 
-        args = (rust_vec *)
-            kernel->malloc(vec_size<rust_vec*>(argc),
-                           "command line arg interior");
-        args->fill = args->alloc = sizeof(rust_vec*) * argc;
-        for (int i = 0; i < argc; ++i) {
-            rust_str *str = make_str(kernel, argv[i],
-                                     strlen(argv[i]),
-                                     "command line arg");
-            ((rust_str**)&args->data)[i] = str;
-        }
+        args = make_str_vec(kernel, argc, argv);
     }
 
     ~command_line_args() {