提交 5558ebb6 编写于 作者: P Patrick Walton

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

上级 e0f5f259
......@@ -2101,7 +2101,7 @@ unsafe fn from_byte(u: u8) -> ~str { raw::from_bytes([u]) }
/// 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))
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册