libcore: Fix level-of-indirection problem in str::buf_as_slice
This commit is contained in:
parent
e0f5f25911
commit
5558ebb6b7
@ -2101,7 +2101,7 @@ mod raw {
|
||||
|
||||
/// Form a slice from a *u8 buffer of the given length without copying.
|
||||
unsafe fn buf_as_slice<T>(buf: *u8, len: uint, f: fn(&& &str) -> T) -> T {
|
||||
let v = (*buf, len + 1);
|
||||
let v = (buf, len + 1);
|
||||
assert is_utf8(::cast::reinterpret_cast(&v));
|
||||
f(::cast::transmute(move v))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user