diff options
| author | Malo Jaffré <jaffre.malo@gmail.com> | 2017-10-09 20:09:08 +0200 |
|---|---|---|
| committer | Malo Jaffré <jaffre.malo@gmail.com> | 2017-10-09 20:09:08 +0200 |
| commit | 679457ad2a0f33aed6b206107afedcccf5124374 (patch) | |
| tree | c8dadff4dbf6cbf813ced769f221cb6402c6665f /src/librustc_data_structures | |
| parent | eabef0608b030ca8844545837967b29ca4a058b7 (diff) | |
| download | rust-679457ad2a0f33aed6b206107afedcccf5124374.tar.gz rust-679457ad2a0f33aed6b206107afedcccf5124374.zip | |
Refactor to use `debug_struct` in several Debug impls
Fixes #44771.
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/graph/mod.rs | 15 |
1 files changed, 2 insertions, 13 deletions
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<N> { pub data: N, } +#[derive(Debug)] pub struct Edge<E> { next_edge: [EdgeIndex; 2], // see module comment source: NodeIndex, @@ -69,18 +70,6 @@ impl<N> SnapshotVecDelegate for Edge<N> { fn reverse(_: &mut Vec<Edge<N>>, _: ()) {} } -impl<E: Debug> Debug for Edge<E> { - 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); |
