Skip to content

Commit 9414c4e

Browse files
committed
Link cstr from_bytes to tracking issue
1 parent 16f218b commit 9414c4e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libstd/ffi/c_str.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ impl CStr {
439439
/// Creates a C string wrapper from a byte slice.
440440
///
441441
/// 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
443443
/// nul bytes.
444444
///
445445
/// # Examples
@@ -453,8 +453,8 @@ impl CStr {
453453
/// assert!(cstr.is_some());
454454
/// # }
455455
/// ```
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> {
458458
if bytes.is_empty() || memchr::memchr(0, &bytes) != Some(bytes.len() - 1) {
459459
None
460460
} else {
@@ -482,8 +482,8 @@ impl CStr {
482482
/// }
483483
/// # }
484484
/// ```
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 {
487487
mem::transmute(bytes)
488488
}
489489

0 commit comments

Comments
 (0)