Closed
Description
Issue by canndrew
Wednesday Oct 15, 2014 at 15:59 GMT
For earlier discussion, see rust-lang/rust#18065
This issue was labelled with: B-RFC, I-enhancement in the Rust repository
There's already b"foo"
syntax for [u8]
literals and I've seen talk of adding s"foo"
for String
literals (perhaps through a syntax extension). If we're going down that path we could also add c"foo"
syntax which could be either a CString
or a *const i8
. This would be useful for interacting with foreign C code. Currently, to call a C function with a string constant I'm using
foo(b"my string\0".as_ptr() as *const i8)
But that's a little cumbersome (and error-prone if I accidentally leave the NUL off).
Metadata
Metadata
Assignees
Labels
No labels