Function std::string::raw::from_buf_lenDeprecated
[-]
[+]
[src]
pub unsafe fn from_buf_len(buf: *const u8, len: uint) -> String
Creates a String
from a *const u8
buffer of the given length.
This function is unsafe because of two reasons:
- A raw pointer is dereferenced and transmuted to
&[u8]
; - The slice is not checked to see whether it contains valid UTF-8.