about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2013-03-21 22:59:33 +0100
committerMarvin Löbel <loebel.marvin@gmail.com>2013-03-21 23:06:04 +0100
commitee2f3d9673407db3ca5a0eb24e01ef52c7fc676c (patch)
treef85fe06cfa6bfab47ddfe9c55e9c91c2a67495d6 /src/librustc
parented25a674ac6bc53c9ee9f8c1cce21541f6811d4b (diff)
downloadrust-ee2f3d9673407db3ca5a0eb24e01ef52c7fc676c.tar.gz
rust-ee2f3d9673407db3ca5a0eb24e01ef52c7fc676c.zip
Switched over substr and trim functions in str to be non-allocating, temporary renamed them to better track use-sites
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/driver/driver.rs2
-rw-r--r--src/librustc/middle/trans/expr.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs
index b983fa316d3..dbf78b70c3b 100644
--- a/src/librustc/driver/driver.rs
+++ b/src/librustc/driver/driver.rs
@@ -543,7 +543,7 @@ pub fn build_session_options(+binary: ~str,
     let lint_dict = lint::get_lint_dict();
     for lint_levels.each |level| {
         let level_name = lint::level_to_str(*level);
-        let level_short = level_name.substr(0,1).to_upper();
+        let level_short = level_name.substr_DBGBRWD(0,1).to_upper();
         let flags = vec::append(getopts::opt_strs(matches, level_short),
                                 getopts::opt_strs(matches, level_name));
         for flags.each |lint_name| {
diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs
index fb63f5384fb..ce3cc30642d 100644
--- a/src/librustc/middle/trans/expr.rs
+++ b/src/librustc/middle/trans/expr.rs
@@ -1849,6 +1849,7 @@ fn trans_assign_op(bcx: block,
     return result_datum.copy_to_datum(bcx, DROP_EXISTING, dst_datum);
 }
 
+// NOTE: Mode neccessary here?
 fn shorten(+x: ~str) -> ~str {
-    if x.len() > 60 { x.substr(0, 60) } else { x }
+    if x.len() > 60 { x.substr_DBGBRWD(0, 60).to_owned() } else { x }
 }