Amanieu / cstr_core

Implementation of CStr and CString for no_std environments
Apache License 2.0
41 stars 17 forks source link

Conversion from String to CString ? #1

Closed vsiles closed 4 years ago

vsiles commented 6 years ago

Hi ! I'm looking for a crate that could help me deal with some embedded C code. My goal is to use String/str in my Rust code, and transform them into CString/CStr before calling external C code.

Is this possible with your crate ? I didn't saw anything about that in the doc.

(I'm new to Rust, maybe my idea is not possible at the moment)

Best, V.

Amanieu commented 4 years ago

You should just be able to use CString::new() for this.