summaryrefslogtreecommitdiffstats
path: root/vendor/gsgdt/tests/helpers.rs
blob: 2184e1c88d2a2b589d782a2a883f46f4bd18b619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use gsgdt;
use serde_json;

use std::fs::File;
use std::io::prelude::*;

use gsgdt::*;

pub fn read_graph_from_file(file: &str) -> Graph{
    let mut file = File::open(file).unwrap();
    let mut contents = String::new();
    file.read_to_string(&mut contents).unwrap();
    serde_json::from_str(&contents).unwrap()
}