#![allow(dead_code)] // still WIP
-use std::fmt::{Formatter, Error, Show};
+use std::fmt::{Formatter, Error, Debug};
use std::uint;
use std::collections::BitvSet;
pub data: E,
}
-impl<E: Show> Show for Edge<E> {
+impl<E: Debug> Debug for Edge<E> {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error> {
- write!(f, "Edge {{ next_edge: [{}, {}], source: {}, target: {}, data: {} }}",
+ write!(f, "Edge {{ next_edge: [{:?}, {:?}], source: {:?}, target: {:?}, data: {:?} }}",
self.next_edge[0], self.next_edge[1], self.source,
self.target, self.data)
}
#[cfg(test)]
mod test {
use middle::graph::*;
- use std::fmt::Show;
+ use std::fmt::Debug;
type TestNode = Node<&'static str>;
type TestEdge = Edge<&'static str>;
});
}
- fn test_adjacent_edges<N:PartialEq+Show,E:PartialEq+Show>(graph: &Graph<N,E>,
+ fn test_adjacent_edges<N:PartialEq+Debug,E:PartialEq+Debug>(graph: &Graph<N,E>,
start_index: NodeIndex,
start_data: N,
expected_incoming: &[(E,N)],
graph.each_incoming_edge(start_index, |edge_index, edge| {
assert!(graph.edge_data(edge_index) == &edge.data);
assert!(counter < expected_incoming.len());
- debug!("counter={} expected={} edge_index={} edge={}",
+ debug!("counter={:?} expected={:?} edge_index={:?} edge={:?}",
counter, expected_incoming[counter], edge_index, edge);
match expected_incoming[counter] {
(ref e, ref n) => {
graph.each_outgoing_edge(start_index, |edge_index, edge| {
assert!(graph.edge_data(edge_index) == &edge.data);
assert!(counter < expected_outgoing.len());
- debug!("counter={} expected={} edge_index={} edge={}",
+ debug!("counter={:?} expected={:?} edge_index={:?} edge={:?}",
counter, expected_outgoing[counter], edge_index, edge);
match expected_outgoing[counter] {
(ref e, ref n) => {