We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8062d92 commit e19fb33Copy full SHA for e19fb33
src/main.rs
@@ -21,7 +21,20 @@ impl fmt::Display for Info {
21
s.push_str(&("Number of lines: ".blue().bold().to_string() + &format!("{}\n", self.number_of_lines)));
22
s.push_str(&("License: ".blue().bold().to_string() + &format!("{}\n", self.license)));
23
s.push_str(&self.get_ascii().blue().bold().to_string());
24
- write!(f, "{}", s)
+
25
+ let logo= self.get_ascii();
26
+ let mut lines = s.lines();
27
+ let left_pad = logo.lines().map(|l| l.len()).max().unwrap_or(0);
28
+ let mut o = String::new();
29
+ for a in logo.lines() {
30
+ let b = match lines.next() {
31
+ Some(line) => line,
32
+ None => "",
33
+ };
34
+ o.push_str(&format!("{:width$} {}\n", a, b, width = left_pad));
35
+ }
36
37
+ write!(f, "{}", o)
38
}
39
40
0 commit comments