We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 319aba9 commit e3253ffCopy full SHA for e3253ff
glib/src/gstring.rs
@@ -367,6 +367,12 @@ unsafe impl Send for GString {}
367
unsafe impl Sync for GString {}
368
369
impl GString {
370
+ // rustdoc-stripper-ignore-next
371
+ /// Creates a GLib string by consuming a byte vector, without checking for UTF-8 or interior 0
372
+ /// bytes. Trailing 0 byte will be appended by this function.
373
+ pub unsafe fn from_utf8_unchecked(v: Vec<u8>) -> Self {
374
+ GString(Inner::Native(Some(CString::from_vec_unchecked(v))))
375
+ }
376
// rustdoc-stripper-ignore-next
377
/// Return the `GString` as string slice.
378
pub fn as_str(&self) -> &str {
0 commit comments