Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nits in tuple to_str implementation #6975

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/libstd/to_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl<A:ToStr> ToStr for (A,) {
fn to_str(&self) -> ~str {
match *self {
(ref a,) => {
~"(" + a.to_str() + ",)"
fmt!("(%s,)", (*a).to_str())
}
}
}
Expand Down Expand Up @@ -91,11 +91,11 @@ impl<A:ToStr+Hash+Eq> ToStr for HashSet<A> {
impl<A:ToStr,B:ToStr> ToStr for (A, B) {
#[inline(always)]
fn to_str(&self) -> ~str {
// FIXME(#4760): this causes an llvm assertion
// FIXME(#4653): this causes an llvm assertion
//let &(ref a, ref b) = self;
match *self {
(ref a, ref b) => {
~"(" + a.to_str() + ", " + b.to_str() + ")"
fmt!("(%s, %s)", (*a).to_str(), (*b).to_str())
}
}
}
Expand All @@ -104,7 +104,7 @@ impl<A:ToStr,B:ToStr> ToStr for (A, B) {
impl<A:ToStr,B:ToStr,C:ToStr> ToStr for (A, B, C) {
#[inline(always)]
fn to_str(&self) -> ~str {
// FIXME(#4760): this causes an llvm assertion
// FIXME(#4653): this causes an llvm assertion
//let &(ref a, ref b, ref c) = self;
match *self {
(ref a, ref b, ref c) => {
Expand Down