File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ impl CStr {
439
439
/// Creates a C string wrapper from a byte slice.
440
440
///
441
441
/// This function will cast the provided `bytes` to a `CStr` wrapper after
442
- /// ensuring that it is null terminated but does not contain any interior
442
+ /// ensuring that it is null terminated and does not contain any interior
443
443
/// nul bytes.
444
444
///
445
445
/// # Examples
@@ -453,8 +453,8 @@ impl CStr {
453
453
/// assert!(cstr.is_some());
454
454
/// # }
455
455
/// ```
456
- #[ unstable( feature = "cstr_from_bytes" , reason = "recently added" , issue = "0 " ) ]
457
- pub fn from_bytes_with_nul < ' a > ( bytes : & ' a [ u8 ] ) -> Option < & ' a CStr > {
456
+ #[ unstable( feature = "cstr_from_bytes" , reason = "recently added" , issue = "31190 " ) ]
457
+ pub fn from_bytes_with_nul ( bytes : & [ u8 ] ) -> Option < & CStr > {
458
458
if bytes. is_empty ( ) || memchr:: memchr ( 0 , & bytes) != Some ( bytes. len ( ) - 1 ) {
459
459
None
460
460
} else {
@@ -482,8 +482,8 @@ impl CStr {
482
482
/// }
483
483
/// # }
484
484
/// ```
485
- #[ unstable( feature = "cstr_from_bytes" , reason = "recently added" , issue = "0 " ) ]
486
- pub unsafe fn from_bytes_with_nul_unchecked < ' a > ( bytes : & ' a [ u8 ] ) -> & ' a CStr {
485
+ #[ unstable( feature = "cstr_from_bytes" , reason = "recently added" , issue = "31190 " ) ]
486
+ pub unsafe fn from_bytes_with_nul_unchecked ( bytes : & [ u8 ] ) -> & CStr {
487
487
mem:: transmute ( bytes)
488
488
}
489
489
You can’t perform that action at this time.
0 commit comments