fn _make_twitter_graph<G: Graph<u32, i32>>(source: &str, graph: &mut G) {
    let reader = BufReader::new(File::open(source).unwrap());
    let mut nodes: HashMap<u32, G::TIndex> = HashMap::new();

    for readline in reader.lines() {
        let line = readline.ok().expect("read error");
        let elts: Vec<&str> = line[..].split_whitespace().collect();
        let src: u32 = elts[0].parse().ok().expect("malformed src");
        let tgt: u32 = elts[1].parse().ok().expect("malformed tgt");
        if !nodes.contains_key(&src) {
            nodes.insert(src, graph.add_node(src));
        }
        if !nodes.contains_key(&tgt) {
            nodes.insert(tgt, graph.add_node(tgt));
        }
        graph.add_edge(*nodes.get(&src).unwrap(), *nodes.get(&tgt).unwrap(), 1);
    }
}
// source: filepath to twitter data eg. "path/to/twitter_rv.net"
filepath to twitter data eg.
filepath to twitter data eg .
fn _make_twitter_graph<G: Graph<u32, i32>>(source: &str, graph: &mut G) {
    let reader = BufReader::new(File::open(source).unwrap());
    let mut nodes: HashMap<u32, G::TIndex> = HashMap::new();
    for readline in reader.lines() {
        let line = readline.ok().expect("read error");
        let elts: Vec<&str> = line[..].split_whitespace().collect();
        let src: u32 = elts[0].parse().ok().expect("malformed src");
        let tgt: u32 = elts[1].parse().ok().expect("malformed tgt");
        if !nodes.contains_key(&src) {
            nodes.insert(src, graph.add_node(src));
        }
        if !nodes.contains_key(&tgt) {
            nodes.insert(tgt, graph.add_node(tgt));
        }
        graph.add_edge(*nodes.get(&src).unwrap(), *nodes.get(&tgt).unwrap(), 1);
    }
}
fn _make_twitter_graph < G : Graph < u32 , i32 > > ( source : & str , graph : & mut G ) { let reader = BufReader :: new ( File :: open ( source ) . unwrap ( ) ) ; let mut nodes : HashMap < u32 , G :: TIndex > = HashMap :: new ( ) ; for readline in reader . lines ( ) { let line = readline . ok ( ) . expect ( " " ) ; let elts : Vec < & str > = line [ .. ] . split_whitespace ( ) . collect ( ) ; let src : u32 = elts [ 0 ] . parse ( ) . ok ( ) . expect ( " " ) ; let tgt : u32 = elts [ 1 ] . parse ( ) . ok ( ) . expect ( " " ) ; if ! nodes . contains_key ( & src ) { nodes . insert ( src , graph . add_node ( src ) ) ; } if ! nodes . contains_key ( & tgt ) { nodes . insert ( tgt , graph . add_node ( tgt ) ) ; } graph . add_edge ( * nodes . get ( & src ) . unwrap ( ) , * nodes . get ( & tgt ) . unwrap ( ) , 1 ) ; } }
source: filepath to twitter data eg.
source : filepath to twitter data eg .
source
&str
graph
&mut G
source
&str
graph
&mut G