summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-04-09 21:07:53 +0200
committermo8it <mo8it@proton.me>2024-04-09 21:07:53 +0200
commitf0ce2c1afa21fdaa34aed8f21c1ef4d3c47cebdd (patch)
treebf428b63104f597cb3ab5c4fd60b49c5b47ee809 /src/main.rs
parent850c1d0234b2c1ae09a8f1c8f669e23a324fd644 (diff)
Improve event handling in the watch mode
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 356b77c..6af66bd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -85,7 +85,8 @@ Did you already install Rust?
Try running `cargo --version` to diagnose the problem.",
)?;
- let exercises = InfoFile::parse()?.exercises;
+ // Leaking is not a problem since the exercises are used until the end of the program.
+ let exercises = InfoFile::parse()?.exercises.leak();
if matches!(args.command, Some(Subcommands::Init)) {
init::init(&exercises).context("Initialization failed")?;
@@ -110,7 +111,7 @@ If you are just starting with Rustlings, run the command `rustlings init` to ini
match args.command {
None | Some(Subcommands::Watch) => {
- watch::watch(&state_file, &exercises)?;
+ watch::watch(&state_file, exercises)?;
}
// `Init` is handled above.
Some(Subcommands::Init) => (),