diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-11-21 17:10:42 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-11-25 11:22:23 -0500 |
| commit | 3293ab14e24d136d0482bb18afef577aebed251e (patch) | |
| tree | c21d2568d6eaf1cc1835034cf2557277c4e8d58b /src/libsyntax | |
| parent | 48ca6d1840818e4a8977d00ed62cf0e8e0e5d193 (diff) | |
| download | rust-3293ab14e24d136d0482bb18afef577aebed251e.tar.gz rust-3293ab14e24d136d0482bb18afef577aebed251e.zip | |
Deprecate MaybeOwned[Vector] in favor of Cow
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index a88029e087b..b5358e7d485 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -272,13 +272,13 @@ impl<'a> StringReader<'a> { /// Converts CRLF to LF in the given string, raising an error on bare CR. fn translate_crlf<'a>(&self, start: BytePos, - s: &'a str, errmsg: &'a str) -> str::MaybeOwned<'a> { + s: &'a str, errmsg: &'a str) -> str::CowString<'a> { let mut i = 0u; while i < s.len() { let str::CharRange { ch, next } = s.char_range_at(i); if ch == '\r' { if next < s.len() && s.char_at(next) == '\n' { - return translate_crlf_(self, start, s, errmsg, i).into_maybe_owned(); + return translate_crlf_(self, start, s, errmsg, i).into_cow(); } let pos = start + BytePos(i as u32); let end_pos = start + BytePos(next as u32); @@ -286,7 +286,7 @@ impl<'a> StringReader<'a> { } i = next; } - return s.into_maybe_owned(); + return s.into_cow(); fn translate_crlf_(rdr: &StringReader, start: BytePos, s: &str, errmsg: &str, mut i: uint) -> String { @@ -550,7 +550,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_maybe_owned() }; + } else { string.into_cow() }; token::DocComment(token::intern(string.as_slice())) } else { token::Comment diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a9306c71240..c731a0005f8 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4966,10 +4966,10 @@ impl<'a> Parser<'a> { let mut err = String::from_str("circular modules: "); let len = included_mod_stack.len(); for p in included_mod_stack.slice(i, len).iter() { - err.push_str(p.display().as_maybe_owned().as_slice()); + err.push_str(p.display().as_cow().as_slice()); err.push_str(" -> "); } - err.push_str(path.display().as_maybe_owned().as_slice()); + err.push_str(path.display().as_cow().as_slice()); self.span_fatal(id_sp, err.as_slice()); } None => () |
