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