File tree 1 file changed +0
-31
lines changed 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -249,16 +249,6 @@ impl CStrBuf {
249
249
self . ptr
250
250
}
251
251
252
- /// Return a mutable pointer to the NUL-terminated string data.
253
- ///
254
- /// `.as_mut_ptr` returns an internal pointer into the `CStrBuf`, and
255
- /// may be invalidated when the `CStrBuf` falls out of scope (the
256
- /// destructor will run, freeing the allocation if there is
257
- /// one).
258
- pub fn as_mut_ptr ( & self ) -> * mut libc:: c_char {
259
- self . ptr as * mut _
260
- }
261
-
262
252
/// Returns an iterator over the string's bytes.
263
253
pub fn iter < ' a > ( & ' a self ) -> CChars < ' a > {
264
254
CChars {
@@ -365,27 +355,6 @@ impl CString {
365
355
self . buf . as_ptr ( )
366
356
}
367
357
368
- /// Return a mutable pointer to the NUL-terminated string data.
369
- ///
370
- /// `.as_mut_ptr` returns an internal pointer into the `CString`, and
371
- /// may be invalidated when the `CString` falls out of scope (the
372
- /// destructor will run, freeing the allocation if there is
373
- /// one).
374
- ///
375
- /// ```rust
376
- /// let foo = "some string";
377
- ///
378
- /// // right
379
- /// let mut x = foo.to_c_str();
380
- /// let p = x.as_mut_ptr();
381
- ///
382
- /// // wrong (the CString will be freed, invalidating `p`)
383
- /// let p = foo.to_c_str().as_mut_ptr();
384
- /// ```
385
- pub fn as_mut_ptr ( & self ) -> * mut libc:: c_char {
386
- self . buf . as_mut_ptr ( )
387
- }
388
-
389
358
/// Converts the `CString` into a `&[u8]` without copying.
390
359
/// Includes the terminating NUL byte.
391
360
#[ inline]
You can’t perform that action at this time.
0 commit comments