mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-05-15 09:48:45 +00:00
Turn unnecessary closure into regular function
This commit is contained in:
parent
03c5baf35c
commit
c658a997f3
@ -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() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user