Skip to content

Commit 29cbbc1

Browse files
committed
doc: Add comment to prevent same error (also now test must catch it)
1 parent e19b738 commit 29cbbc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/c.rs

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

0 commit comments

Comments
 (0)