aboutsummaryrefslogtreecommitdiff
path: root/src/dependency_trace.rs
blob: d46b762c54b28cf8b5e75e38412e4c75b1360711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![allow(clippy::module_name_repetitions)]

#[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(" -> ")
}