File tree 3 files changed +15
-0
lines changed
3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 12
12
- [ alloc_system] ( alloc-system.md )
13
13
- [ allocator] ( allocator.md )
14
14
- [ allow_internal_unstable] ( allow-internal-unstable.md )
15
+ - [ as_c_str] ( as-c-str.md )
15
16
- [ as_unsafe_cell] ( as-unsafe-cell.md )
16
17
- [ ascii_ctype] ( ascii-ctype.md )
17
18
- [ asm] ( asm.md )
Original file line number Diff line number Diff line change
1
+ # ` as_c_str `
2
+
3
+ The tracking issue for this feature is: [ #40380 ]
4
+
5
+ [ #40380 ] : https://github.com/rust-lang/rust/issues/40380
6
+
7
+ ------------------------
8
+
Original file line number Diff line number Diff line change @@ -324,6 +324,12 @@ impl CString {
324
324
& self . inner
325
325
}
326
326
327
+ /// Extracts a `CStr` slice containing the entire string.
328
+ #[ unstable( feature = "as_c_str" , issue = "40380" ) ]
329
+ pub fn as_c_str ( & self ) -> & CStr {
330
+ & * self
331
+ }
332
+
327
333
/// Converts this `CString` into a boxed `CStr`.
328
334
#[ unstable( feature = "into_boxed_c_str" , issue = "40380" ) ]
329
335
pub fn into_boxed_c_str ( self ) -> Box < CStr > {
You can’t perform that action at this time.
0 commit comments