diff --git a/src/libcore/to_str.rs b/src/libcore/to_str.rs index 3806335e2408..299ba45986e6 100644 --- a/src/libcore/to_str.rs +++ b/src/libcore/to_str.rs @@ -72,6 +72,24 @@ impl ToStr for HashMap { } } +impl ToStr for HashSet { + #[inline(always)] + fn to_str(&self) -> ~str { + let mut acc = ~"{", first = true; + for self.each |element| { + if first { + first = false; + } + else { + acc.push_str(", "); + } + acc.push_str(element.to_str()); + } + acc.push_char('}'); + acc + } +} + impl ToStr for (A, B) { #[inline(always)] fn to_str(&self) -> ~str {