Skip to content

Commit 45099e6

Browse files
committed
Add inline attr to private CString::into_inner
1 parent cdbe288 commit 45099e6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/std/src/ffi/c_str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ impl CString {
672672
}
673673

674674
/// Bypass "move out of struct which implements [`Drop`] trait" restriction.
675+
#[inline]
675676
fn into_inner(self) -> Box<[u8]> {
676677
// Rationale: `mem::forget(self)` invalidates the previous call to `ptr::read(&self.inner)`
677678
// so we use `ManuallyDrop` to ensure `self` is not dropped.

0 commit comments

Comments
 (0)