1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2026-05-18 09:51:14 +02:00

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