Skip to content

Commit b69a511

Browse files
author
christopherdumas
committed
Added anchors for the code snippets.
1 parent 320880e commit b69a511

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/doc/trpl/error-handling.md

+3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ thread '<main>' panicked at 'Invalid number: 11', src/bin/panic-simple.rs:5
8787
Here's another example that is slightly less contrived. A program that accepts
8888
an integer as an argument, doubles it and prints it.
8989

90+
<a name="code-unwrap-double"/>
9091
```rust,should_panic
92+
9193
use std::env;
9294
9395
fn main() {
@@ -137,6 +139,7 @@ system is an important concept because it will cause the compiler to force the
137139
programmer to handle that absence. Let's take a look at an example that tries
138140
to find a character in a string:
139141

142+
<a name="code-option-ex-string-find"/>
140143
```rust
141144
// Searches `haystack` for the Unicode character `needle`. If one is found, the
142145
// byte offset of the character is returned. Otherwise, `None` is returned.

0 commit comments

Comments
 (0)