libstd: switch ebml's wr_tagged_str to use str::byte_slice

This commit is contained in:
Erick Tryzelaar 2012-08-22 18:34:14 -07:00
parent cfa71a135b
commit 007e47d710

View File

@ -285,13 +285,7 @@ impl writer {
}
fn wr_tagged_str(tag_id: uint, v: ~str) {
// Lame: can't use str::as_bytes() here because the resulting
// vector is NULL-terminated. Annoyingly, the underlying
// writer interface doesn't permit us to write a slice of a
// vector. We need first-class slices, I think.
// str::as_bytes(v) {|b| self.wr_tagged_bytes(tag_id, b); }
self.wr_tagged_bytes(tag_id, str::bytes(v));
str::byte_slice(v, |b| self.wr_tagged_bytes(tag_id, b));
}
fn wr_bytes(b: &[u8]) {