Here's another example that is slightly less contrived. A program that accepts
an integer as an argument, doubles it and prints it.
-<a name="code-unwrap-double"/>
+<div id="code-unwrap-double">
```rust,should_panic
use std::env;
println!("{}", 2 * n);
}
```
+</div>
If you give this program zero arguments (error 1) or if the first argument
isn't an integer (error 2), the program will panic just like in the first
programmer to handle that absence. Let's take a look at an example that tries
to find a character in a string:
-<a name="code-option-ex-string-find"/>
+<div id="code-option-ex-string-find">
```rust
// Searches `haystack` for the Unicode character `needle`. If one is found, the
// byte offset of the character is returned. Otherwise, `None` is returned.
None
}
```
+</div>
Notice that when this function finds a matching character, it doen't just
return the `offset`. Instead, it returns `Some(offset)`. `Some` is a variant or