Skip to content

Commit a492033

Browse files
authored
fix: Remove string cleaning in error report (#303)
* Remove string splitting in error report * Add module comment
1 parent 4ccd0a5 commit a492033

File tree

1 file changed

+7
-10
lines changed
  • rust/stackablectl/src/output

1 file changed

+7
-10
lines changed

rust/stackablectl/src/output/mod.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//! This module contains helper structs and functions to render the CLI output
2+
//! based on templates. These templates allow dynamic composition of the output.
3+
//! The output offers sections for pre, post and command hints, as well as
4+
//! success and error output. The [`ErrorReport`] serves as an alternative to
5+
//! snafu's [`Report`](snafu::Report).
6+
17
use std::{
28
fmt::Write,
39
ops::{Deref, DerefMut},
@@ -59,16 +65,7 @@ where
5965
let mut index = 1;
6066

6167
while let Some(source) = error.source() {
62-
let source_string = source.to_string();
63-
64-
let cleaned = if let Some((cleaned, _)) = source_string.split_once(':') {
65-
cleaned
66-
} else {
67-
&source_string
68-
};
69-
70-
writeln!(report, " {}: {}", index, cleaned)?;
71-
68+
writeln!(report, " {}: {}", index, source)?;
7269
error = source;
7370
index += 1;
7471
}

0 commit comments

Comments
 (0)