Skip to content

Commit ca66b81

Browse files
committed
std: Remove an unnecessary comment from c_str
The documentation for `.with_c_str()` already says that the pointer will be deallocated before returning from the function.
1 parent e02d1eb commit ca66b81

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/libstd/c_str.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,6 @@ impl<'self> ToCStr for &'self [u8] {
277277
}
278278
}
279279

280-
/// WARNING: This function uses an optimization to only malloc a temporary
281-
/// CString when the source string is small. Do not save a reference to
282-
/// the `*libc::c_char` as it may be invalid after this function call.
283280
fn with_c_str<T>(&self, f: &fn(*libc::c_char) -> T) -> T {
284281
if self.len() < BUF_LEN {
285282
do self.as_imm_buf |self_buf, self_len| {

0 commit comments

Comments
 (0)