@@ -294,12 +294,12 @@ impl CStrBuf {
294
294
295
295
/// Unwraps the wrapped `*libc::c_char` from the `CStrBuf` wrapper
296
296
/// without running the destructor. If the string was allocated,
297
- /// a user of `.unwrap ()` should ensure the allocation is eventually
297
+ /// a user of `.into_inner ()` should ensure the allocation is eventually
298
298
/// freed.
299
299
///
300
300
/// Prefer `.as_ptr()` when just retrieving a pointer to the
301
301
/// string data, as that does not relinquish ownership.
302
- pub unsafe fn unwrap ( mut self ) -> * const libc:: c_char {
302
+ pub unsafe fn into_inner ( mut self ) -> * const libc:: c_char {
303
303
self . dtor = None ;
304
304
self . ptr
305
305
}
@@ -438,13 +438,13 @@ impl CString {
438
438
439
439
/// Unwraps the raw character pointer from the `CString`
440
440
/// without running the destructor. If the string was allocated,
441
- /// a user of `.unwrap ()` should ensure the allocation is eventually
441
+ /// a user of `.into_inner ()` should ensure the allocation is eventually
442
442
/// freed.
443
443
///
444
444
/// Prefer `.as_ptr()` when just retrieving a pointer to the
445
445
/// string data, as that does not relinquish ownership.
446
- pub unsafe fn unwrap ( self ) -> * const libc:: c_char {
447
- self . buf . unwrap ( )
446
+ pub unsafe fn into_inner ( self ) -> * const libc:: c_char {
447
+ self . buf . into_inner ( )
448
448
}
449
449
450
450
/// Return the number of bytes in the CString
@@ -1094,9 +1094,9 @@ mod tests {
1094
1094
}
1095
1095
1096
1096
#[ test]
1097
- fn test_unwrap ( ) {
1097
+ fn test_into_inner ( ) {
1098
1098
let c_str = "hello" . to_c_str ( ) ;
1099
- unsafe { libc:: free ( c_str. unwrap ( ) as * mut libc:: c_void ) }
1099
+ unsafe { libc:: free ( c_str. into_inner ( ) as * mut libc:: c_void ) }
1100
1100
}
1101
1101
1102
1102
#[ test]
0 commit comments