From c2f8cf9dc18f30456178ae529afca1c962257dc0 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 3 Sep 2012 12:33:18 -0700 Subject: [PATCH] libcore: Remove as_bytes_slice --- src/libcore/str.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcore/str.rs b/src/libcore/str.rs index b3f58ce2558..cdfcbf4cd27 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -24,6 +24,7 @@ export // Reinterpretation as_bytes, + as_bytes_slice, as_buf, as_c_str, @@ -1751,6 +1752,10 @@ pure fn as_bytes(s: ~str, f: fn(~[u8]) -> T) -> T { } } +pure fn as_bytes_slice(s: &a/str) -> &a/[u8] { + unsafe { ::unsafe::reinterpret_cast(&s) } +} + /** * Work with the byte buffer of a string as a null-terminated C string. *