trippy-tui 0.13.0

A network diagnostic tool
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[cfg(test)]
pub fn insta<F: FnOnce()>(name: &str, f: F) {
    let mut settings = insta::Settings::new();
    settings.set_snapshot_suffix(name.replace(' ', "_"));
    settings.set_snapshot_path("../tests/resources/snapshots");
    settings.set_omit_expression(true);
    settings.bind(f);
}

#[cfg(test)]
pub fn remove_whitespace(mut s: String) -> String {
    s.retain(|c| !c.is_whitespace());
    s
}