Skip to content

Commit 1772ee3

Browse files
committed
Remove a few more usages of std::str from rustc. Issue #855
1 parent dc6f785 commit 1772ee3

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/comp/middle/trans.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import std::int;
1616
import std::str;
1717
import std::istr;
1818
import std::uint;
19-
import std::str::rustrt::sbuf;
2019
import std::map;
2120
import std::map::hashmap;
2221
import std::option;

src/comp/middle/trans_common.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import std::vec::to_ptr;
99
import std::str;
1010
import std::istr;
1111
import std::uint;
12-
import std::str::rustrt::sbuf;
1312
import std::map;
1413
import std::map::hashmap;
1514
import std::option;

src/comp/syntax/codemap.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,17 @@ fn maybe_highlight_lines(sp: &option::t<span>, cm: &codemap,
174174

175175
// indent past |name:## | and the 0-offset column location
176176
let left = istr::char_len(fm.name) + digits + lo.col + 3u;
177-
let s = "";
178-
while left > 0u { str::push_char(s, ' '); left -= 1u; }
177+
let s = ~"";
178+
while left > 0u { istr::push_char(s, ' '); left -= 1u; }
179179

180-
s += "^";
180+
s += ~"^";
181181
let hi = lookup_char_pos(cm, option::get(sp).hi);
182182
if hi.col != lo.col {
183183
// the ^ already takes up one space
184184
let width = hi.col - lo.col - 1u;
185-
while width > 0u { str::push_char(s, '~'); width -= 1u; }
185+
while width > 0u { istr::push_char(s, '~'); width -= 1u; }
186186
}
187-
io::stdout().write_str(istr::from_estr(s + "\n"));
187+
io::stdout().write_str(s + ~"\n");
188188
}
189189
}
190190
_ { }

0 commit comments

Comments
 (0)