libcore: Fix level-of-indirection problem in str::buf_as_slice

This commit is contained in:
Patrick Walton 2012-09-20 15:04:17 -07:00
parent e0f5f25911
commit 5558ebb6b7

View file

@ -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))
}