From b69a51164d078b00d97a4aa7d4a91ec3f4f5a074 Mon Sep 17 00:00:00 2001 From: christopherdumas Date: Tue, 15 Sep 2015 10:31:48 -0700 Subject: [PATCH] Added anchors for the code snippets. --- src/doc/trpl/error-handling.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/doc/trpl/error-handling.md b/src/doc/trpl/error-handling.md index 2b590c82a89bf..0687c2b13b5b5 100644 --- a/src/doc/trpl/error-handling.md +++ b/src/doc/trpl/error-handling.md @@ -87,7 +87,9 @@ thread '
' panicked at 'Invalid number: 11', src/bin/panic-simple.rs:5 Here's another example that is slightly less contrived. A program that accepts an integer as an argument, doubles it and prints it. + ```rust,should_panic + use std::env; fn main() { @@ -137,6 +139,7 @@ system is an important concept because it will cause the compiler to force the programmer to handle that absence. Let's take a look at an example that tries to find a character in a string: + ```rust // Searches `haystack` for the Unicode character `needle`. If one is found, the // byte offset of the character is returned. Otherwise, `None` is returned.