Skip to content

Commit f0dbd1c

Browse files
committed
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 rust-lang#2370.
1 parent d710ea4 commit f0dbd1c

3 files changed

+4
-4
lines changed

src/ch12-01-accepting-command-line-arguments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ throughout the rest of the program. We do that in Listing 12-2.
102102

103103
<span class="filename">Filename: src/main.rs</span>
104104

105-
```rust,should_panic
105+
```rust,noplayground
106106
{{#rustdoc_include ../listings/ch12-an-io-project/listing-12-02/src/main.rs}}
107107
```
108108

src/ch12-02-reading-a-file.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ shown in Listing 12-4.
2222

2323
<span class="filename">Filename: src/main.rs</span>
2424

25-
```rust,should_panic
25+
```rust,noplayground
2626
{{#rustdoc_include ../listings/ch12-an-io-project/listing-12-04/src/main.rs:here}}
2727
```
2828

src/ch12-03-improving-error-handling-and-modularity.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Listing 12-6 shows the improvements to the `parse_config` function.
119119

120120
<span class="filename">Filename: src/main.rs</span>
121121

122-
```rust,should_panic
122+
```rust,noplayground
123123
{{#rustdoc_include ../listings/ch12-an-io-project/listing-12-06/src/main.rs:here}}
124124
```
125125

@@ -187,7 +187,7 @@ shows the changes we need to make.
187187

188188
<span class="filename">Filename: src/main.rs</span>
189189

190-
```rust,should_panic
190+
```rust,noplayground
191191
{{#rustdoc_include ../listings/ch12-an-io-project/listing-12-07/src/main.rs:here}}
192192
```
193193

0 commit comments

Comments
 (0)