std::str: remove from_utf8.
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
This commit is contained in:
parent
9635c763ba
commit
9d64e46013
31 changed files with 119 additions and 223 deletions
|
|
@ -487,8 +487,8 @@ mod test {
|
|||
|
||||
let nread = result.unwrap();
|
||||
assert!(nread > 0);
|
||||
let read_str = str::from_utf8(read_mem.slice(0, nread as uint));
|
||||
assert_eq!(read_str, ~"hello");
|
||||
let read_str = str::from_utf8_slice(read_mem.slice_to(nread as uint));
|
||||
assert_eq!(read_str, "hello");
|
||||
}
|
||||
// unlink
|
||||
let result = FsRequest::unlink(l(), &path_str.to_c_str());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue