@@ -87,7 +87,7 @@ thread '<main>' panicked at 'Invalid number: 11', src/bin/panic-simple.rs:5
8787Here's another example that is slightly less contrived. A program that accepts
8888an 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
9393use std::env;
@@ -99,6 +99,7 @@ fn main() {
9999 println!("{}", 2 * n);
100100}
101101```
102+ </div >
102103
103104If you give this program zero arguments (error 1) or if the first argument
104105isn'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
139140programmer to handle that absence. Let's take a look at an example that tries
140141to 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
156158Notice that when this function finds a matching character, it doen't just
157159return the ` offset ` . Instead, it returns ` Some(offset) ` . ` Some ` is a variant or
0 commit comments