Skip to content

Commit 007e47d

Browse files
committed
libstd: switch ebml's wr_tagged_str to use str::byte_slice
1 parent cfa71a1 commit 007e47d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/libstd/ebml.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,7 @@ impl writer {
285285
}
286286

287287
fn wr_tagged_str(tag_id: uint, v: ~str) {
288-
// Lame: can't use str::as_bytes() here because the resulting
289-
// vector is NULL-terminated. Annoyingly, the underlying
290-
// writer interface doesn't permit us to write a slice of a
291-
// vector. We need first-class slices, I think.
292-
293-
// str::as_bytes(v) {|b| self.wr_tagged_bytes(tag_id, b); }
294-
self.wr_tagged_bytes(tag_id, str::bytes(v));
288+
str::byte_slice(v, |b| self.wr_tagged_bytes(tag_id, b));
295289
}
296290

297291
fn wr_bytes(b: &[u8]) {

0 commit comments

Comments
 (0)