Skip to content

Commit

Permalink
syntax: remove uses of .into_cow()
Browse files Browse the repository at this point in the history
  • Loading branch information
erickt committed Apr 21, 2015
1 parent ca0ee4c commit cfb9d28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/libsyntax/lib.rs
Expand Up @@ -34,7 +34,6 @@
#![feature(unicode)]
#![feature(path_ext)]
#![feature(str_char)]
#![feature(into_cow)]

extern crate arena;
extern crate fmt_macros;
Expand Down
8 changes: 4 additions & 4 deletions src/libsyntax/parse/lexer/mod.rs
Expand Up @@ -16,7 +16,7 @@ use ext::tt::transcribe::tt_next_token;
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;
Expand Down Expand Up @@ -293,15 +293,15 @@ impl<'a> StringReader<'a> {
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);
self.err_span_(pos, end_pos, errmsg);
}
i = next;
}
return s.into_cow();
return s.into();

fn translate_crlf_(rdr: &StringReader, start: BytePos,
s: &str, errmsg: &str, mut i: usize) -> String {
Expand Down Expand Up @@ -564,7 +564,7 @@ impl<'a> StringReader<'a> {
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
Expand Down

0 comments on commit cfb9d28

Please sign in to comment.