From 6ade7396511398033830515b7e819e3d0c31ead8 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 27 Apr 2023 14:45:41 -0700 Subject: [PATCH] Ensure code blocks are editable (#597) We should default to making code blocks editable: this ensures consistent syntax highlighting (see #343) and it allows the instructor to freely edit anything they want. --- src/error-handling/panic-unwind.md | 2 +- src/error-handling/result.md | 2 +- src/hello-world.md | 2 +- src/testing/unit-tests.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/error-handling/panic-unwind.md b/src/error-handling/panic-unwind.md index 6eaf6d35..beada987 100644 --- a/src/error-handling/panic-unwind.md +++ b/src/error-handling/panic-unwind.md @@ -2,7 +2,7 @@ By default, a panic will cause the stack to unwind. The unwinding can be caught: -```rust +```rust,editable use std::panic; let result = panic::catch_unwind(|| { diff --git a/src/error-handling/result.md b/src/error-handling/result.md index c9e8942e..0a6740e7 100644 --- a/src/error-handling/result.md +++ b/src/error-handling/result.md @@ -3,7 +3,7 @@ We have already seen the `Result` enum. This is used pervasively when errors are expected as part of normal operation: -```rust +```rust,editable use std::fs::File; use std::io::Read; diff --git a/src/hello-world.md b/src/hello-world.md index e1c94f51..0a13ddeb 100644 --- a/src/hello-world.md +++ b/src/hello-world.md @@ -3,7 +3,7 @@ Let us jump into the simplest possible Rust program, a classic Hello World program: -```rust +```rust,editable fn main() { println!("Hello 🌍!"); } diff --git a/src/testing/unit-tests.md b/src/testing/unit-tests.md index 0b0396d2..130899ce 100644 --- a/src/testing/unit-tests.md +++ b/src/testing/unit-tests.md @@ -2,7 +2,7 @@ Mark unit tests with `#[test]`: -```rust,ignore +```rust,editable,ignore fn first_word(text: &str) -> &str { match text.find(' ') { Some(idx) => &text[..idx],