From 5bd380656e5fbb9f5416a1e1159ef4759a3fd679 Mon Sep 17 00:00:00 2001 From: GrayJack Date: Fri, 15 Mar 2024 14:50:03 -0300 Subject: [PATCH] feat(buffer): Add `JanetBuffer::push_janet_string` method --- src/types/buffer.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/types/buffer.rs b/src/types/buffer.rs index 6642451ef5..5a43f86bc4 100644 --- a/src/types/buffer.rs +++ b/src/types/buffer.rs @@ -334,6 +334,13 @@ impl JanetBuffer<'_> { unsafe { evil_janet::janet_buffer_push_u64(self.raw, elem) } } + /// Append the given [`JanetString`] onto the end of the buffer + #[inline] + #[crate::cjvg("1.9.1")] + pub fn push_janet_string(&mut self, string: &JanetString) { + unsafe { evil_janet::janet_buffer_push_string(self.raw, string.raw) } + } + /// Append the given c-string slice onto the end of the buffer. #[inline] pub fn push_cstr(&mut self, cstr: &CStr) {