prty_bitgraph 0.1.1

A simple unlabeled graph library with transformations for wrappers
use super::Graph;
use std::fmt::*;
extern crate prty_fmtmodifier;
pub use self::prty_fmtmodifier::*;

#[derive(Default, Debug, Clone, Copy)]
pub struct JustPrinter;

impl<G: Graph> Format<G> for JustPrinter
where
    G::Node: Debug,
{
    fn fmt(&self, w: &G, f: &mut Formatter) -> Result {
        for to in w.nodes() {
            write!(f, "{:?} <- ", to)?;
            for from in w.iter_to(to) {
                write!(f, "{:?} & ", from)?;
            }
            write!(f, "; ")?;
        }
        Ok(())
    }
}