Skip to content

Commit 021e6d3

Browse files
committed
auto merge of #6975 : artagnon/rust/tuple-tostr, r=bstrie
[1/2] fixes a couple of comments. [2/2] uses fmt! instead of hand-concatenating strings in a couple of places. No functional changes.
2 parents 8450dc8 + 01c4f11 commit 021e6d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libstd/to_str.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<A:ToStr> ToStr for (A,) {
4444
fn to_str(&self) -> ~str {
4545
match *self {
4646
(ref a,) => {
47-
~"(" + a.to_str() + ",)"
47+
fmt!("(%s,)", (*a).to_str())
4848
}
4949
}
5050
}
@@ -91,11 +91,11 @@ impl<A:ToStr+Hash+Eq> ToStr for HashSet<A> {
9191
impl<A:ToStr,B:ToStr> ToStr for (A, B) {
9292
#[inline(always)]
9393
fn to_str(&self) -> ~str {
94-
// FIXME(#4760): this causes an llvm assertion
94+
// FIXME(#4653): this causes an llvm assertion
9595
//let &(ref a, ref b) = self;
9696
match *self {
9797
(ref a, ref b) => {
98-
~"(" + a.to_str() + ", " + b.to_str() + ")"
98+
fmt!("(%s, %s)", (*a).to_str(), (*b).to_str())
9999
}
100100
}
101101
}
@@ -104,7 +104,7 @@ impl<A:ToStr,B:ToStr> ToStr for (A, B) {
104104
impl<A:ToStr,B:ToStr,C:ToStr> ToStr for (A, B, C) {
105105
#[inline(always)]
106106
fn to_str(&self) -> ~str {
107-
// FIXME(#4760): this causes an llvm assertion
107+
// FIXME(#4653): this causes an llvm assertion
108108
//let &(ref a, ref b, ref c) = self;
109109
match *self {
110110
(ref a, ref b, ref c) => {

0 commit comments

Comments
 (0)