From f0dbd1c2474eb50de9dfd7fa63ab6d5f351ed0d0 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sun, 28 Feb 2021 20:07:03 -0500 Subject: [PATCH] Disable playground button on listings in ch 12 that use CLI args You can't pass CLI args to the playground, so it doesn't make sense to run them in the browser. Also, these were marked as should_panic, because if you *do* run them in the browser or without arguments, they panic, but that's not the happy path we're writing, so "should" panic isn't really correct. Fixes #2370. --- src/ch12-01-accepting-command-line-arguments.md | 2 +- src/ch12-02-reading-a-file.md | 2 +- src/ch12-03-improving-error-handling-and-modularity.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ch12-01-accepting-command-line-arguments.md b/src/ch12-01-accepting-command-line-arguments.md index 8b5aefd98..29d117185 100644 --- a/src/ch12-01-accepting-command-line-arguments.md +++ b/src/ch12-01-accepting-command-line-arguments.md @@ -102,7 +102,7 @@ throughout the rest of the program. We do that in Listing 12-2. Filename: src/main.rs -```rust,should_panic +```rust,noplayground {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-02/src/main.rs}} ``` diff --git a/src/ch12-02-reading-a-file.md b/src/ch12-02-reading-a-file.md index 2ca1c24cb..05e56c7db 100644 --- a/src/ch12-02-reading-a-file.md +++ b/src/ch12-02-reading-a-file.md @@ -22,7 +22,7 @@ shown in Listing 12-4. Filename: src/main.rs -```rust,should_panic +```rust,noplayground {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-04/src/main.rs:here}} ``` diff --git a/src/ch12-03-improving-error-handling-and-modularity.md b/src/ch12-03-improving-error-handling-and-modularity.md index e24d43e7f..3f3bb13b4 100644 --- a/src/ch12-03-improving-error-handling-and-modularity.md +++ b/src/ch12-03-improving-error-handling-and-modularity.md @@ -119,7 +119,7 @@ Listing 12-6 shows the improvements to the `parse_config` function. Filename: src/main.rs -```rust,should_panic +```rust,noplayground {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-06/src/main.rs:here}} ``` @@ -187,7 +187,7 @@ shows the changes we need to make. Filename: src/main.rs -```rust,should_panic +```rust,noplayground {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-07/src/main.rs:here}} ```