aboutsummaryrefslogtreecommitdiff
path: root/src/dependency_trace.rs
blob: 86906f40c449834d7d9fef329c74efe48bb1a056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[must_use]
pub fn create_dependency_trace(
    dependency_history: &[&'static str],
    err_dependency: &'static str,
) -> String
{
    dependency_history
        .iter()
        .map(|dep| {
            if dep == &err_dependency {
                format!("\x1b[1m{}\x1b[22m", dep)
            } else {
                (*dep).to_string()
            }
        })
        .collect::<Vec<_>>()
        .join(" -> ")
}