Turn unnecessary closure into regular function

This commit is contained in:
Remo Senekowitsch 2026-04-20 13:49:17 +02:00
parent 03c5baf35c
commit c658a997f3
No known key found for this signature in database

View File

@ -233,7 +233,7 @@ impl<'a> ListState<'a> {
)?; )?;
next_ln(stdout)?; next_ln(stdout)?;
let hotkey = |writer: &mut MaxLenWriter, hotkey| -> io::Result<()> { fn hotkey(writer: &mut MaxLenWriter, hotkey: &[u8]) -> io::Result<()> {
writer writer
.stdout .stdout
.queue(SetForegroundColor(Color::Yellow))? .queue(SetForegroundColor(Color::Yellow))?
@ -241,7 +241,7 @@ impl<'a> ListState<'a> {
writer.write_ascii(hotkey)?; writer.write_ascii(hotkey)?;
writer.stdout.queue(ResetColor)?; writer.stdout.queue(ResetColor)?;
Ok(()) Ok(())
}; }
let mut writer = MaxLenWriter::new(stdout, self.term_width as usize); let mut writer = MaxLenWriter::new(stdout, self.term_width as usize);
if self.message.is_empty() { if self.message.is_empty() {