fix: ch10-03 - misleading use of expect on .split

This commit is contained in:
Florian TREHAUT
2024-05-25 00:28:25 +07:00
parent 85442a6084
commit e551b7fb75
2 changed files with 2 additions and 2 deletions

View File

@@ -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,
};

View File

@@ -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,
};