about summary refs log tree commit diff
path: root/src/lib
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2011-04-27 13:06:19 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-04-27 13:06:19 -0700
commit4c7886de8008b07e892ea741be08291dae38f7bd (patch)
tree32623b15f45c4f81d2ff167e9caddf1d5b2740cd /src/lib
parentfef8314c2e018d2e35c8bd91d3181de038e44de2 (diff)
downloadrust-4c7886de8008b07e892ea741be08291dae38f7bd.tar.gz
rust-4c7886de8008b07e892ea741be08291dae38f7bd.zip
Fix _str.bytes to trivial version.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/_str.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/_str.rs b/src/lib/_str.rs
index 41a86cf3cbb..44f14fb6e1c 100644
--- a/src/lib/_str.rs
+++ b/src/lib/_str.rs
@@ -5,6 +5,7 @@ import _vec.rustrt.vbuf;
 native "rust" mod rustrt {
     type sbuf;
     fn str_buf(str s) -> sbuf;
+    fn str_vec(str s) -> vec[u8];
     fn str_byte_len(str s) -> uint;
     fn str_alloc(uint n_bytes) -> str;
     fn str_from_vec(vec[mutable? u8] b) -> str;
@@ -126,10 +127,7 @@ fn buf(str s) -> sbuf {
 }
 
 fn bytes(str s) -> vec[u8] {
-    fn ith(str s, uint i) -> u8 {
-        ret s.(i);
-    }
-    ret _vec.init_fn[u8](bind ith(s, _), byte_len(s));
+    ret rustrt.str_vec(s);
 }
 
 fn from_bytes(vec[u8] v) : is_utf8(v) -> str {