File tree 1 file changed +7
-10
lines changed
rust/stackablectl/src/output
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change
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
+
1
7
use std:: {
2
8
fmt:: Write ,
3
9
ops:: { Deref , DerefMut } ,
59
65
let mut index = 1 ;
60
66
61
67
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) ?;
72
69
error = source;
73
70
index += 1 ;
74
71
}
You can’t perform that action at this time.
0 commit comments