Skip to content

Commit 4970f67

Browse files
committed
doc: Refactor of comment position and split in two lines about lifetime fixed
1 parent 29cbbc1 commit 4970f67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/c.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ use super::panic_if_null;
1919
///
2020
/// If the C string is not a valid UTF-8 string.
2121
#[must_use]
22-
#[inline] // ATTENTION!: 'a lifetime is needed, does NOT REMOVE it, see commit 5a03be91d2da8909986db7c54650f3a7863a91ff fixing 3a1d15f33e8e418ef6bee2b7b9e096780bd2c8ac
22+
#[inline]
2323
pub unsafe fn ref_str<'a>(string: *const c_char) -> Result<&'a str, Utf8Error> {
24+
// ATTENTION! 'a lifetime is required, does NOT REMOVE it
25+
// see commit 5a03be91d2da8909986db7c54650f3a7863a91ff fixing 3a1d15f33e8e418ef6bee2b7b9e096780bd2c8ac
2426
#[cfg(any(feature = "panic-if-null", debug_assertions))]
2527
panic_if_null(string);
2628
// CAUTION: this is unsafe

0 commit comments

Comments
 (0)