Skip to content

Commit 50d36fb

Browse files
Remove specialization from Debug implementations
1 parent 08c20bb commit 50d36fb

File tree

4 files changed

+1
-49
lines changed

4 files changed

+1
-49
lines changed

src/librand/distributions/mod.rs

-12
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@ pub struct Weighted<T> {
9494
pub item: T,
9595
}
9696

97-
impl<T> fmt::Debug for Weighted<T> {
98-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
99-
f.pad("Weighted")
100-
}
101-
}
102-
10397
impl<T: fmt::Debug> fmt::Debug for Weighted<T> {
10498
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10599
f.debug_struct("Weighted")
@@ -212,12 +206,6 @@ impl<'a, T: Clone> IndependentSample<T> for WeightedChoice<'a, T> {
212206
}
213207
}
214208

215-
impl<'a, T> fmt::Debug for WeightedChoice<'a, T> {
216-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
217-
f.pad("WeightedChoice")
218-
}
219-
}
220-
221209
impl<'a, T: fmt::Debug> fmt::Debug for WeightedChoice<'a, T> {
222210
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
223211
f.debug_struct("WeightedChoice")

src/librand/distributions/range.rs

-6
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ impl<Sup: SampleRange> IndependentSample<Sup> for Range<Sup> {
5858
}
5959
}
6060

61-
impl<X> fmt::Debug for Range<X> {
62-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
63-
f.pad("Range { .. }")
64-
}
65-
}
66-
6761
impl<X: fmt::Debug> fmt::Debug for Range<X> {
6862
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6963
f.debug_struct("Range")

src/librand/lib.rs

-24
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,6 @@ impl<'a, T: Rand, R: Rng> Iterator for Generator<'a, T, R> {
291291
}
292292
}
293293

294-
impl<'a, T, R> fmt::Debug for Generator<'a, T, R> {
295-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
296-
f.pad("Generator { .. }")
297-
}
298-
}
299-
300294
impl<'a, T, R: fmt::Debug> fmt::Debug for Generator<'a, T, R> {
301295
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
302296
f.debug_struct("Generator")
@@ -323,12 +317,6 @@ impl<'a, R: Rng> Iterator for AsciiGenerator<'a, R> {
323317
}
324318
}
325319

326-
impl<'a, R> fmt::Debug for AsciiGenerator<'a, R> {
327-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
328-
f.pad("AsciiGenerator { .. }")
329-
}
330-
}
331-
332320
impl<'a, R: fmt::Debug> fmt::Debug for AsciiGenerator<'a, R> {
333321
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
334322
f.debug_struct("AsciiGenerator")
@@ -446,12 +434,6 @@ impl Rand for XorShiftRng {
446434
/// `[0,1)`.
447435
pub struct Open01<F>(pub F);
448436

449-
impl<F> fmt::Debug for Open01<F> {
450-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
451-
f.pad("Open01 { .. }")
452-
}
453-
}
454-
455437
impl<F: fmt::Debug> fmt::Debug for Open01<F> {
456438
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
457439
f.debug_tuple("Open01")
@@ -468,12 +450,6 @@ impl<F: fmt::Debug> fmt::Debug for Open01<F> {
468450
/// `[0,1)`.
469451
pub struct Closed01<F>(pub F);
470452

471-
impl<F> fmt::Debug for Closed01<F> {
472-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
473-
f.pad("Closed01 { .. }")
474-
}
475-
}
476-
477453
impl<F: fmt::Debug> fmt::Debug for Closed01<F> {
478454
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
479455
f.debug_tuple("Closed01")

src/librand/reseeding.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,8 @@ impl<S, R: SeedableRng<S>, Rsdr: Reseeder<R> + Default>
9595
}
9696
}
9797

98-
impl<R, Rsdr> fmt::Debug for ReseedingRng<R, Rsdr> {
99-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
100-
f.pad("ReseedingRng { .. }")
101-
}
102-
}
103-
10498
impl<R: fmt::Debug, Rsdr: fmt::Debug> fmt::Debug for ReseedingRng<R, Rsdr> {
105-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
99+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
106100
f.debug_struct("ReseedingRng")
107101
.field("rng", &self.rng)
108102
.field("generation_threshold", &self.generation_threshold)

0 commit comments

Comments
 (0)