File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -279,11 +279,11 @@ fn extension(file_name: &str) -> Option<&str> {
279
279
}
280
280
```
281
281
282
- One other pattern that we find it very common is assigning a default value to
283
- the case when an ` Option ` value is ` None ` . For example, maybe your program
284
- assumes that the extension of a file is ` rs ` even if none is present. As you
285
- might imagine, the case analysis for this is not specific to file
286
- extensions - it can work with any ` Option<T> ` :
282
+ One other pattern we commonly find is assigning a default value to the case
283
+ when an ` Option ` value is ` None ` . For example, maybe your program assumes that
284
+ the extension of a file is ` rs ` even if none is present. As you might imagine,
285
+ the case analysis for this is not specific to file extensions - it can work
286
+ with any ` Option<T> ` :
287
287
288
288
``` rust
289
289
fn unwrap_or <T >(option : Option <T >, default : T ) -> T {
You can’t perform that action at this time.
0 commit comments