diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dependency_trace.rs | 20 | ||||
-rw-r--r-- | src/lib.rs | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/dependency_trace.rs b/src/dependency_trace.rs new file mode 100644 index 0000000..d46b762 --- /dev/null +++ b/src/dependency_trace.rs @@ -0,0 +1,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(" -> ") +} @@ -20,6 +20,9 @@ pub use syrette_macros::*; pub mod castable_factory; #[doc(hidden)] +pub mod dependency_trace; + +#[doc(hidden)] pub mod libs; // Private |