Skip to content

Commit 53ba768

Browse files
committed
Auto merge of #28492 - Ms2ger:a-name, r=steveklabnik
The id attribute has been an official part of HTML since 1997. There is no reason not to use it.
2 parents cff0411 + 1a3b422 commit 53ba768

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/doc/trpl/error-handling.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ 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"/>
90+
<div id="code-unwrap-double">
9191
```rust,should_panic
9292
9393
use std::env;
@@ -99,6 +99,7 @@ fn main() {
9999
println!("{}", 2 * n);
100100
}
101101
```
102+
</div>
102103

103104
If you give this program zero arguments (error 1) or if the first argument
104105
isn't an integer (error 2), the program will panic just like in the first
@@ -139,7 +140,7 @@ system is an important concept because it will cause the compiler to force the
139140
programmer to handle that absence. Let's take a look at an example that tries
140141
to find a character in a string:
141142

142-
<a name="code-option-ex-string-find"/>
143+
<div id="code-option-ex-string-find">
143144
```rust
144145
// Searches `haystack` for the Unicode character `needle`. If one is found, the
145146
// byte offset of the character is returned. Otherwise, `None` is returned.
@@ -152,6 +153,7 @@ fn find(haystack: &str, needle: char) -> Option<usize> {
152153
None
153154
}
154155
```
156+
</div>
155157

156158
Notice that when this function finds a matching character, it doen't just
157159
return the `offset`. Instead, it returns `Some(offset)`. `Some` is a variant or

0 commit comments

Comments
 (0)