@@ -21,48 +21,49 @@ impl<W: Write> Printer<W> {
21
21
let colors: Vec < Color > = Vec :: new ( ) ;
22
22
let mut buf = String :: new ( ) ;
23
23
24
- if !self . info . config . art_off {
25
- if let Some ( custom_image) = & self . info . config . image {
26
- if let Some ( image_backend) = & self . info . config . image_backend {
27
- buf. push_str ( & image_backend. add_image (
28
- info_lines. map ( |s| format ! ( "{}{}" , center_pad, s) ) . collect ( ) ,
29
- custom_image,
30
- ) ) ;
31
- } else {
32
- panic ! ( "No image backend found" )
33
- }
24
+ if self . info . config . art_off {
25
+ buf. push_str ( & info_str) ;
26
+ } else if let Some ( custom_image) = & self . info . config . image {
27
+ if let Some ( image_backend) = & self . info . config . image_backend {
28
+ buf. push_str ( & image_backend. add_image (
29
+ info_lines. map ( |s| format ! ( "{}{}" , center_pad, s) ) . collect ( ) ,
30
+ custom_image,
31
+ ) ) ;
32
+ } else {
33
+ panic ! ( "No image backend found" )
34
+ }
35
+ } else {
36
+ let mut logo_lines = if let Some ( custom_ascii) = & self . info . config . ascii_input {
37
+ AsciiArt :: new ( custom_ascii, & colors, !self . info . config . no_bold )
34
38
} else {
35
- let mut logo_lines = if let Some ( custom_ascii) = & self . info . config . ascii_input {
36
- AsciiArt :: new ( custom_ascii, & colors, !self . info . config . no_bold )
37
- } else {
38
- AsciiArt :: new (
39
- self . get_ascii ( ) ,
40
- & self . info . colors ,
41
- !self . info . config . no_bold ,
42
- )
43
- } ;
39
+ AsciiArt :: new (
40
+ self . get_ascii ( ) ,
41
+ & self . info . colors ,
42
+ !self . info . config . no_bold ,
43
+ )
44
+ } ;
44
45
45
- loop {
46
- match ( logo_lines. next ( ) , info_lines. next ( ) ) {
47
- ( Some ( logo_line) , Some ( info_line) ) => {
48
- buf. push_str ( & format ! ( "{}{}{:^}\n " , logo_line, center_pad, info_line) )
49
- }
50
- ( Some ( logo_line) , None ) => buf. push_str ( & format ! ( "{}\n " , logo_line) ) ,
51
- ( None , Some ( info_line) ) => buf. push_str ( & format ! (
52
- "{:<width$}{}{:^}\n " ,
53
- "" ,
54
- center_pad,
55
- info_line,
56
- width = logo_lines. width( )
57
- ) ) ,
58
- ( None , None ) => {
59
- buf. push ( '\n' ) ;
60
- break ;
61
- }
46
+ loop {
47
+ match ( logo_lines. next ( ) , info_lines. next ( ) ) {
48
+ ( Some ( logo_line) , Some ( info_line) ) => {
49
+ buf. push_str ( & format ! ( "{}{}{:^}\n " , logo_line, center_pad, info_line) )
50
+ }
51
+ ( Some ( logo_line) , None ) => buf. push_str ( & format ! ( "{}\n " , logo_line) ) ,
52
+ ( None , Some ( info_line) ) => buf. push_str ( & format ! (
53
+ "{:<width$}{}{:^}\n " ,
54
+ "" ,
55
+ center_pad,
56
+ info_line,
57
+ width = logo_lines. width( )
58
+ ) ) ,
59
+ ( None , None ) => {
60
+ buf. push ( '\n' ) ;
61
+ break ;
62
62
}
63
63
}
64
64
}
65
65
}
66
+
66
67
writeln ! ( self . writer, "{}" , buf) ?;
67
68
68
69
Ok ( ( ) )
0 commit comments