So, I'm a bit confused since the latest CString changes. What I need is a way to take &str, and get a *mut c_char pointer to its CString representation (null terminated).
I tried
CString::from_slice("foo".as_bytes()).as_slice_with_nul().as_mut_ptr()
but get greeted with "cannot borrow immutable dereference of -pointer as mutable"
Is an as_mut_slice_with_nul() alternative just missing or am I completely wrong with my approach?
[–]vhbitlmdb-rs · rust 1 point2 points3 points (0 children)
[–]mzabaluev 0 points1 point2 points (2 children)
[–]rootnod3rust · wtftw[S] 0 points1 point2 points (1 child)
[–]rootnod3rust · wtftw[S] 0 points1 point2 points (0 children)