wolf-graph 0.1.0

Data structures and algorithms for working with graphs with reference or value semantics.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use wolf_graph::prelude::*;

pub fn format_ids<T: std::fmt::Display, C: IntoIterator<Item = T>>(ids: C) -> String {
    let mut s = "[".to_string();
    let mut iter = ids.into_iter();
    if let Some(id) = iter.next() {
        s.push_str(&id.to_string());
        for id in iter {
            s.push_str(", ");
            s.push_str(&id.to_string());
        }
    }
    s.push(']');
    s
}