mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 23:36:30 +00:00
Show the current exercise path
This commit is contained in:
parent
62e92476e6
commit
a59acf8835
2 changed files with 7 additions and 1 deletions
|
@ -49,7 +49,7 @@ pub fn progress_bar(progress: u16, total: u16, line_width: u16) -> Result<String
|
|||
write!(line, "{}", red_part.red()).unwrap();
|
||||
}
|
||||
|
||||
write!(line, "] {progress:>3}/{total} exercises").unwrap();
|
||||
writeln!(line, "] {progress:>3}/{total} exercises").unwrap();
|
||||
|
||||
Ok(line)
|
||||
}
|
||||
|
|
|
@ -149,6 +149,12 @@ You can keep working on this exercise or jump into the next one by removing the
|
|||
let progress_bar = progress_bar(self.progress, self.exercises.len() as u16, line_width)?;
|
||||
self.writer.write_all(progress_bar.as_bytes())?;
|
||||
|
||||
self.writer.write_all(b"Current exercise: ")?;
|
||||
self.writer.write_fmt(format_args!(
|
||||
"{}",
|
||||
self.exercise.path.to_string_lossy().bold()
|
||||
))?;
|
||||
|
||||
self.show_prompt()?;
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue