diff options
| author | bors <bors@rust-lang.org> | 2014-04-06 23:36:38 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-06 23:36:38 -0700 |
| commit | e4779b505092cf1a394c187eb77ab2738be6f280 (patch) | |
| tree | 9a0199b15bd0b4e7b352b58e3c123e89d70af5d2 /src/libsyntax/parse/comments.rs | |
| parent | 31e8f2448c8cdd913566d5cb9a5cb9f0c014dcbc (diff) | |
| parent | fcf9b30f426fcf8fd0b6e0a044825fdfa4a1bfdb (diff) | |
| download | rust-e4779b505092cf1a394c187eb77ab2738be6f280.tar.gz rust-e4779b505092cf1a394c187eb77ab2738be6f280.zip | |
auto merge of #13165 : sfackler/rust/io-vec, r=alexcrichton
`Reader`, `Writer`, `MemReader`, `MemWriter`, and `MultiWriter` now work with `Vec<u8>` instead of `~[u8]`. This does introduce some extra copies since `from_utf8_owned` isn't usable anymore, but I think that can't be helped until `~str`'s representation changes.
Diffstat (limited to 'src/libsyntax/parse/comments.rs')
| -rw-r--r-- | src/libsyntax/parse/comments.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 3bf1474c461..bb812f7f6b4 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -350,7 +350,7 @@ pub fn gather_comments_and_literals(span_diagnostic: srdr: &mut io::Reader) -> (Vec<Comment>, Vec<Literal>) { let src = srdr.read_to_end().unwrap(); - let src = str::from_utf8_owned(src).unwrap(); + let src = str::from_utf8(src.as_slice()).unwrap().to_owned(); let cm = CodeMap::new(); let filemap = cm.new_filemap(path, src); let mut rdr = lexer::new_low_level_string_reader(span_diagnostic, filemap); |
