@@ -217,16 +217,13 @@ fn main() {
217217 println ! ( "Failed to write rust-project.json to disk for rust-analyzer" ) ;
218218 } else {
219219 println ! ( "Successfully generated rust-project.json" ) ;
220- println ! ( "rust-analyzer will now parse exercises, restart your language server or editor" )
220+ println ! ( "rust-analyzer will now parse exercises, restart your language server or editor" ) ;
221221 }
222222 }
223223
224224 Subcommands :: Watch { success_hints } => match watch ( & exercises, verbose, success_hints) {
225225 Err ( e) => {
226- println ! (
227- "Error: Could not watch your progress. Error message was {:?}." ,
228- e
229- ) ;
226+ println ! ( "Error: Could not watch your progress. Error message was {e:?}." ) ;
230227 println ! ( "Most likely you've run out of disk space or your 'inotify limit' has been reached." ) ;
231228 std:: process:: exit ( 1 ) ;
232229 }
@@ -280,7 +277,7 @@ fn spawn_watch_shell(
280277 if parts. is_empty ( ) {
281278 println ! ( "no command provided" ) ;
282279 } else if let Err ( e) = Command :: new ( parts[ 0 ] ) . args ( & parts[ 1 ..] ) . status ( ) {
283- println ! ( "failed to execute command `{}`: {}" , cmd , e ) ;
280+ println ! ( "failed to execute command `{cmd }`: {e}" ) ;
284281 }
285282 } else {
286283 println ! ( "unknown command: {input}" ) ;
@@ -292,7 +289,7 @@ fn spawn_watch_shell(
292289}
293290
294291fn find_exercise < ' a > ( name : & str , exercises : & ' a [ Exercise ] ) -> & ' a Exercise {
295- if name. eq ( "next" ) {
292+ if name == "next" {
296293 exercises
297294 . iter ( )
298295 . find ( |e| !e. looks_done ( ) )
@@ -338,15 +335,14 @@ fn watch(
338335
339336 clear_screen ( ) ;
340337
341- let to_owned_hint = |t : & Exercise | t. hint . to_owned ( ) ;
342338 let failed_exercise_hint = match verify (
343339 exercises. iter ( ) ,
344340 ( 0 , exercises. len ( ) ) ,
345341 verbose,
346342 success_hints,
347343 ) {
348344 Ok ( _) => return Ok ( WatchStatus :: Finished ) ,
349- Err ( exercise) => Arc :: new ( Mutex :: new ( Some ( to_owned_hint ( exercise) ) ) ) ,
345+ Err ( exercise) => Arc :: new ( Mutex :: new ( Some ( exercise. hint . clone ( ) ) ) ) ,
350346 } ;
351347 spawn_watch_shell ( & failed_exercise_hint, Arc :: clone ( & should_quit) ) ;
352348 loop {
@@ -383,7 +379,7 @@ fn watch(
383379 Err ( exercise) => {
384380 let mut failed_exercise_hint =
385381 failed_exercise_hint. lock ( ) . unwrap ( ) ;
386- * failed_exercise_hint = Some ( to_owned_hint ( exercise) ) ;
382+ * failed_exercise_hint = Some ( exercise. hint . clone ( ) ) ;
387383 }
388384 }
389385 }
@@ -415,7 +411,7 @@ fn rustc_exists() -> bool {
415411 . unwrap_or ( false )
416412}
417413
418- const DEFAULT_OUT : & str = r# "Thanks for installing Rustlings!
414+ const DEFAULT_OUT : & str = "Thanks for installing Rustlings!
419415
420416Is this your first time? Don't worry, Rustlings was made for beginners! We are
421417going to teach you a lot of things about Rust, but before we can get
@@ -441,7 +437,7 @@ started, here's a couple of notes about how Rustlings operates:
441437 autocompletion, run the command `rustlings lsp`.
442438
443439Got all that? Great! To get started, run `rustlings watch` in order to get the first
444- exercise. Make sure to have your editor open!"# ;
440+ exercise. Make sure to have your editor open!" ;
445441
446442const FENISH_LINE : & str = "+----------------------------------------------------+
447443| You made it to the Fe-nish line! |
0 commit comments