We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9565b47 commit 34a8dbbCopy full SHA for 34a8dbb
text/0000-c-str-deref.md
@@ -113,13 +113,10 @@ made workable in static expressions through a compiler plugin.
113
In cases when an FFI function returns a pointer to a non-owned C string,
114
it might be preferable to wrap the returned string safely as a 'thin'
115
`&CStr` rather than scan it into a slice up front. To facilitate this,
116
-conversion from a raw pointer should be added (using the
117
-[lifetime anchor](https://github.com/rust-lang/rfcs/pull/556) convention):
+conversion from a raw pointer should be added:
118
```rust
119
impl CStr {
120
- pub unsafe fn from_raw_ptr<'a, T: ?Sized>(ptr: *const libc::c_char,
121
- life_anchor: &'a T)
122
- -> &'a CStr
+ pub unsafe fn from_raw_ptr<'a>(ptr: *const libc::c_char) -> &'a CStr
123
{ ... }
124
}
125
```
0 commit comments