File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,17 @@ static THINK_CHARS: Chars = Chars {
55
55
angled_down_right : "⎝" ,
56
56
angled_down_left : "⎠" ,
57
57
} ;
58
- pub fn generate ( message : & str , format_opts : FormatOptions ) -> String {
58
+
59
+ #[ must_use]
60
+ pub fn generate ( message : & str , format_opts : & FormatOptions ) -> String {
59
61
let think = format_opts. think ;
60
62
let width = format_opts. width ;
61
63
62
64
let chars = if think { & THINK_CHARS } else { & SAY_CHARS } ;
63
- let mut lines = wrap ( & message, width as usize ) ;
65
+ let mut lines = wrap ( message, width as usize ) ;
64
66
let longest = lines. iter ( ) . map ( |line| line. width ( ) ) . max ( ) . unwrap ( ) ;
65
- return format ! (
67
+
68
+ format ! (
66
69
"
67
70
{}
68
71
{}
@@ -106,5 +109,5 @@ pub fn generate(message: &str, format_opts: FormatOptions) -> String {
106
109
chars. bottom. repeat( longest) ,
107
110
chars. arrow,
108
111
chars. arrow,
109
- ) ;
112
+ )
110
113
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ fn main() -> Result<()> {
36
36
width,
37
37
} ;
38
38
39
- let msg = generate ( & args. message , format_opts) ;
39
+ let msg = generate ( & args. message , & format_opts) ;
40
40
41
41
let mut msg_color = console:: Color :: White ;
42
42
let mut cat_color = console:: Color :: White ;
You can’t perform that action at this time.
0 commit comments