Change to avoid repeated "is"

This commit is contained in:
Yoshito Komatsu 2015-10-19 14:23:51 +09:00
parent 5122a6d936
commit 5a15144b95
1 changed files with 5 additions and 5 deletions

View File

@ -279,11 +279,11 @@ fn extension(file_name: &str) -> Option<&str> {
}
```
One other pattern that we find it very common is assigning a default value to
the case when an `Option` value is `None`. For example, maybe your program
assumes that the extension of a file is `rs` even if none is present. As you
might imagine, the case analysis for this is not specific to file
extensions - it can work with any `Option<T>`:
One other pattern we commonly find is assigning a default value to the case
when an `Option` value is `None`. For example, maybe your program assumes that
the extension of a file is `rs` even if none is present. As you might imagine,
the case analysis for this is not specific to file extensions - it can work
with any `Option<T>`:
```rust
fn unwrap_or<T>(option: Option<T>, default: T) -> T {