about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 049fe71384e..679a04b93d6 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -243,6 +243,15 @@ vec_from_buf_shared(rust_task *task, type_desc *ty,
     return v;
 }
 
+extern "C" CDECL void
+rust_istr_push(rust_task* task, rust_vec** sp, uint8_t byte) {
+    size_t fill = (*sp)->fill;
+    reserve_vec(task, sp, fill + 1);
+    (*sp)->data[fill-1] = byte;
+    (*sp)->data[fill] = 0;
+    (*sp)->fill = fill + 1;
+}
+
 extern "C" CDECL rust_str *
 str_from_cstr(rust_task *task, char *sbuf)
 {