File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55### Added
66
7- - Show the file link of the current exercise when running ` rustlings hint `
7+ - Show the file link of the current exercise when running ` rustlings hint ` and ` rustlings reset `
88
99### Fixed
1010
Original file line number Diff line number Diff line change @@ -334,12 +334,10 @@ impl AppState {
334334 Ok ( ( ) )
335335 }
336336
337- pub fn reset_current_exercise ( & mut self ) -> Result < & str > {
337+ pub fn reset_current_exercise ( & mut self ) -> Result < ( ) > {
338338 self . set_pending ( self . current_exercise_ind ) ?;
339339 let exercise = self . current_exercise ( ) ;
340- self . reset ( self . current_exercise_ind , exercise. path ) ?;
341-
342- Ok ( exercise. path )
340+ self . reset ( self . current_exercise_ind , exercise. path )
343341 }
344342
345343 // Reset the exercise by index and return its name.
Original file line number Diff line number Diff line change @@ -149,8 +149,13 @@ fn main() -> Result<ExitCode> {
149149 }
150150 Some ( Command :: Reset { name } ) => {
151151 app_state. set_current_exercise_by_name ( & name) ?;
152- let exercise_path = app_state. reset_current_exercise ( ) ?;
153- println ! ( "The exercise {exercise_path} has been reset" ) ;
152+ app_state. reset_current_exercise ( ) ?;
153+
154+ let current_exercise = app_state. current_exercise ( ) ;
155+ let mut stdout = io:: stdout ( ) . lock ( ) ;
156+ stdout. write_all ( b"The exercise " ) ?;
157+ current_exercise. terminal_file_link ( & mut stdout, app_state. emit_file_links ( ) ) ?;
158+ stdout. write_all ( b" has been reset\n " ) ?;
154159 }
155160 Some ( Command :: Hint { name } ) => {
156161 if let Some ( name) = name {
You can’t perform that action at this time.
0 commit comments