File tree 2 files changed +2
-2
lines changed
listings/ch10-generic-types-traits-and-lifetimes
no-listing-10-lifetimes-on-methods/src
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ struct ImportantExcerpt<'a> {
4
4
5
5
fn main ( ) {
6
6
let novel = String :: from ( "Call me Ishmael. Some years ago..." ) ;
7
- let first_sentence = novel. split ( '.' ) . next ( ) . expect ( "Could not find a '.'" ) ;
7
+ let first_sentence = novel. split ( '.' ) . next ( ) . unwrap ( ) ;
8
8
let i = ImportantExcerpt {
9
9
part : first_sentence,
10
10
} ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ impl<'a> ImportantExcerpt<'a> {
21
21
22
22
fn main ( ) {
23
23
let novel = String :: from ( "Call me Ishmael. Some years ago..." ) ;
24
- let first_sentence = novel. split ( '.' ) . next ( ) . expect ( "Could not find a '.'" ) ;
24
+ let first_sentence = novel. split ( '.' ) . next ( ) . unwrap ( ) ;
25
25
let i = ImportantExcerpt {
26
26
part : first_sentence,
27
27
} ;
You can’t perform that action at this time.
0 commit comments