mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-22 14:59:37 +02:00
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.
This commit is contained in:
parent
5074b1751c
commit
6ade739651
@ -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(|| {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 🌍!");
|
||||
}
|
||||
|
@ -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],
|
||||
|
Loading…
x
Reference in New Issue
Block a user