about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-05-27 12:38:12 -0700
committerbors <bors@rust-lang.org>2013-05-27 12:38:12 -0700
commitb0f3686515410c013f6cd12ce4fc5236e3dee3f2 (patch)
treed8c26fa0f1db08519245c29c5c8d9775fa00cf73 /src/libstd
parentd98cc9995fb5c87230f57eeffb8061df25d85190 (diff)
parent8f80323f09ef150efc5cf729100f99981afc96e1 (diff)
downloadrust-b0f3686515410c013f6cd12ce4fc5236e3dee3f2.tar.gz
rust-b0f3686515410c013f6cd12ce4fc5236e3dee3f2.zip
auto merge of #6703 : sanxiyn/rust/allocation-lint, r=sanxiyn
Fix #6145. In particular, handle operator overloading.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io.rs6
-rw-r--r--src/libstd/to_str.rs4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/io.rs b/src/libstd/io.rs
index 4ce4ea108e5..5cbadaf2df6 100644
--- a/src/libstd/io.rs
+++ b/src/libstd/io.rs
@@ -1711,9 +1711,9 @@ pub fn read_whole_file_str(file: &Path) -> Result<~str, ~str> {
     result::chain(read_whole_file(file), |bytes| {
         if str::is_utf8(bytes) {
             result::Ok(str::from_bytes(bytes))
-       } else {
-           result::Err(file.to_str() + ~" is not UTF-8")
-       }
+        } else {
+            result::Err(file.to_str() + " is not UTF-8")
+        }
     })
 }
 
diff --git a/src/libstd/to_str.rs b/src/libstd/to_str.rs
index 1469471b7ce..9ca54066289 100644
--- a/src/libstd/to_str.rs
+++ b/src/libstd/to_str.rs
@@ -46,7 +46,7 @@ impl<A:ToStr> ToStr for (A,) {
     fn to_str(&self) -> ~str {
         match *self {
             (ref a,) => {
-                ~"(" + a.to_str() + ~", " + ~")"
+                ~"(" + a.to_str() + ",)"
             }
         }
     }
@@ -97,7 +97,7 @@ impl<A:ToStr,B:ToStr> ToStr for (A, B) {
         //let &(ref a, ref b) = self;
         match *self {
             (ref a, ref b) => {
-                ~"(" + a.to_str() + ~", " + b.to_str() + ~")"
+                ~"(" + a.to_str() + ", " + b.to_str() + ")"
             }
         }
     }