Skip to content

Commit

Permalink
Merge pull request #3939 from florian-trehaut/main
Browse files Browse the repository at this point in the history
fix: ch10-03 - misleading use of expect on .split
  • Loading branch information
chriskrycho committed May 27, 2024
2 parents 85442a6 + e551b7f commit e75fe2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ struct ImportantExcerpt<'a> {

fn main() {
let novel = String::from("Call me Ishmael. Some years ago...");
let first_sentence = novel.split('.').next().expect("Could not find a '.'");
let first_sentence = novel.split('.').next().unwrap();
let i = ImportantExcerpt {
part: first_sentence,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<'a> ImportantExcerpt<'a> {

fn main() {
let novel = String::from("Call me Ishmael. Some years ago...");
let first_sentence = novel.split('.').next().expect("Could not find a '.'");
let first_sentence = novel.split('.').next().unwrap();
let i = ImportantExcerpt {
part: first_sentence,
};
Expand Down

0 comments on commit e75fe2c

Please sign in to comment.