diff options
| author | bors <bors@rust-lang.org> | 2014-07-15 18:41:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-15 18:41:05 +0000 |
| commit | b422373d862082b1a27bd7d0e2319a31ad745aae (patch) | |
| tree | f0728d449ed0b611c7d49d991209388f3b3a518f /src/libsyntax/parse | |
| parent | cd54321c085da9e40dd340b738547f7287e3c579 (diff) | |
| parent | 584fbde5d1f9e0048592b44195263dfea0ee8231 (diff) | |
| download | rust-b422373d862082b1a27bd7d0e2319a31ad745aae.tar.gz rust-b422373d862082b1a27bd7d0e2319a31ad745aae.zip | |
auto merge of #15426 : aochagavia/rust/str, r=alexcrichton
* Deprecated `str::from_utf8_owned` in favor of `String::from_utf8` * Deprecated `str::from_utf8_lossy` in favor of `String::from_utf8_lossy` * Deprecated `str::from_utf16` in favor of `String::from_utf16` * Deprecated `str::from_utf16_lossy` in favor of `String::from_utf16_lossy` * Deprecated `str::from_chars` in favor of `String::from_chars` * Deprecated `str::from_char` in favor of `String::from_char` and `.to_string()` * Deprecated `str::from_byte` in favor of `String::from_byte` [breaking-change]
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer/comments.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index 3f3a8a723f1..c53638ed07d 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -339,7 +339,7 @@ pub fn gather_comments_and_literals(span_diagnostic: &diagnostic::SpanHandler, srdr: &mut io::Reader) -> (Vec<Comment>, Vec<Literal>) { let src = srdr.read_to_end().unwrap(); - let src = str::from_utf8(src.as_slice()).unwrap().to_string(); + let src = String::from_utf8(src).unwrap(); let cm = CodeMap::new(); let filemap = cm.new_filemap(path, src); let mut rdr = lexer::StringReader::new_raw(span_diagnostic, filemap); |
