std::vec: remove .as_imm_buf, replaced by .as_ptr & .len.

There's no need for the restrictions of a closure with the above methods.
This commit is contained in:
Huon Wilson
2013-12-18 01:49:31 +11:00
parent ac137f6dbe
commit 4c79b22ef2
16 changed files with 119 additions and 167 deletions

View File

@@ -2502,7 +2502,7 @@ impl<'a> StrSlice<'a> for &'a str {
#[inline]
fn as_imm_buf<T>(&self, f: |*u8, uint| -> T) -> T {
let v: &[u8] = unsafe { cast::transmute(*self) };
v.as_imm_buf(f)
f(v.as_ptr(), v.len())
}
}