File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ ### Added
6+
7+ - Show the file link of the current exercise when running ` rustlings hint `
8+
59### Fixed
610
711- Fix integer overflow on big terminal widths [ @gabfec ] ( https://github.com/gabfec )
Original file line number Diff line number Diff line change @@ -156,7 +156,15 @@ fn main() -> Result<ExitCode> {
156156 if let Some ( name) = name {
157157 app_state. set_current_exercise_by_name ( & name) ?;
158158 }
159- println ! ( "{}" , app_state. current_exercise( ) . hint) ;
159+
160+ let current_exercise = app_state. current_exercise ( ) ;
161+ let mut stdout = io:: stdout ( ) . lock ( ) ;
162+ stdout. write_all ( b"Current exercise: " ) ?;
163+ current_exercise. terminal_file_link ( & mut stdout, app_state. emit_file_links ( ) ) ?;
164+
165+ stdout. write_all ( b"\n \n Hint:\n " ) ?;
166+ stdout. write_all ( current_exercise. hint . as_bytes ( ) ) ?;
167+ stdout. write_all ( b"\n " ) ?;
160168 }
161169 // Handled in an earlier match.
162170 Some ( Command :: Init | Command :: Dev ( _) ) => ( ) ,
You can’t perform that action at this time.
0 commit comments