From 679457ad2a0f33aed6b206107afedcccf5124374 Mon Sep 17 00:00:00 2001 From: Malo Jaffré Date: Mon, 9 Oct 2017 20:09:08 +0200 Subject: Refactor to use `debug_struct` in several Debug impls Fixes #44771. --- src/librustc_data_structures/graph/mod.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/librustc_data_structures') diff --git a/src/librustc_data_structures/graph/mod.rs b/src/librustc_data_structures/graph/mod.rs index 474622f3669..56d5f5ffa3f 100644 --- a/src/librustc_data_structures/graph/mod.rs +++ b/src/librustc_data_structures/graph/mod.rs @@ -31,7 +31,7 @@ //! be indexed by the direction (see the type `Direction`). use bitvec::BitVector; -use std::fmt::{Formatter, Error, Debug}; +use std::fmt::Debug; use std::usize; use snapshot_vec::{SnapshotVec, SnapshotVecDelegate}; @@ -48,6 +48,7 @@ pub struct Node { pub data: N, } +#[derive(Debug)] pub struct Edge { next_edge: [EdgeIndex; 2], // see module comment source: NodeIndex, @@ -69,18 +70,6 @@ impl SnapshotVecDelegate for Edge { fn reverse(_: &mut Vec>, _: ()) {} } -impl Debug for Edge { - fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { - write!(f, - "Edge {{ next_edge: [{:?}, {:?}], source: {:?}, target: {:?}, data: {:?} }}", - self.next_edge[0], - self.next_edge[1], - self.source, - self.target, - self.data) - } -} - #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] pub struct NodeIndex(pub usize); -- cgit 1.4.1-3-g733a5