mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
syntax: remove uses of .into_cow()
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
#![feature(unicode)]
|
||||
#![feature(path_ext)]
|
||||
#![feature(str_char)]
|
||||
#![feature(into_cow)]
|
||||
|
||||
extern crate arena;
|
||||
extern crate fmt_macros;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
use parse::token;
|
||||
use parse::token::str_to_ident;
|
||||
|
||||
use std::borrow::{IntoCow, Cow};
|
||||
use std::borrow::Cow;
|
||||
use std::char;
|
||||
use std::fmt;
|
||||
use std::mem::replace;
|
||||
@@ -293,7 +293,7 @@ fn translate_crlf<'b>(&self, start: BytePos,
|
||||
let next = i + ch.len_utf8();
|
||||
if ch == '\r' {
|
||||
if next < s.len() && s.char_at(next) == '\n' {
|
||||
return translate_crlf_(self, start, s, errmsg, i).into_cow();
|
||||
return translate_crlf_(self, start, s, errmsg, i).into();
|
||||
}
|
||||
let pos = start + BytePos(i as u32);
|
||||
let end_pos = start + BytePos(next as u32);
|
||||
@@ -301,7 +301,7 @@ fn translate_crlf<'b>(&self, start: BytePos,
|
||||
}
|
||||
i = next;
|
||||
}
|
||||
return s.into_cow();
|
||||
return s.into();
|
||||
|
||||
fn translate_crlf_(rdr: &StringReader, start: BytePos,
|
||||
s: &str, errmsg: &str, mut i: usize) -> String {
|
||||
@@ -564,7 +564,7 @@ fn scan_block_comment(&mut self) -> Option<TokenAndSpan> {
|
||||
let string = if has_cr {
|
||||
self.translate_crlf(start_bpos, string,
|
||||
"bare CR not allowed in block doc-comment")
|
||||
} else { string.into_cow() };
|
||||
} else { string.into() };
|
||||
token::DocComment(token::intern(&string[..]))
|
||||
} else {
|
||||
token::Comment
|
||||
|
||||
Reference in New Issue
Block a user