Skip to content

Commit

Permalink
feat(buffer): Add JanetBuffer::push_janet_string method
Browse files Browse the repository at this point in the history
  • Loading branch information
GrayJack committed Mar 15, 2024
1 parent 44138fa commit 5bd3806
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/types/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5bd3806

Please sign in to comment.