Skip to content

Commit 6a58683

Browse files
committed
refactor: i do as clippy demands 🫡
1 parent 8203728 commit 6a58683

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/lib.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,17 @@ static THINK_CHARS: Chars = Chars {
5555
angled_down_right: "⎝",
5656
angled_down_left: "⎠",
5757
};
58-
pub fn generate(message: &str, format_opts: FormatOptions) -> String {
58+
59+
#[must_use]
60+
pub fn generate(message: &str, format_opts: &FormatOptions) -> String {
5961
let think = format_opts.think;
6062
let width = format_opts.width;
6163

6264
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);
6466
let longest = lines.iter().map(|line| line.width()).max().unwrap();
65-
return format!(
67+
68+
format!(
6669
"
6770
{}
6871
{}
@@ -106,5 +109,5 @@ pub fn generate(message: &str, format_opts: FormatOptions) -> String {
106109
chars.bottom.repeat(longest),
107110
chars.arrow,
108111
chars.arrow,
109-
);
112+
)
110113
}

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn main() -> Result<()> {
3636
width,
3737
};
3838

39-
let msg = generate(&args.message, format_opts);
39+
let msg = generate(&args.message, &format_opts);
4040

4141
let mut msg_color = console::Color::White;
4242
let mut cat_color = console::Color::White;

0 commit comments

Comments
 (0)