Skip to content

Commit d54c050

Browse files
committed
Improve a comment in errors2
1 parent 248dd44 commit d54c050

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

exercises/13_error_handling/errors2.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
// the player typed in the quantity, we get it as a string. They might have
66
// typed anything, not just numbers!
77
//
8-
// Right now, this function isn't handling the error case at all (and isn't
9-
// handling the success case properly either). What we want to do is: If we call
10-
// the `total_cost` function on a string that is not a number, that function
11-
// will return a `ParseIntError`. In that case, we want to immediately return
12-
// that error from our function and not try to multiply and add.
8+
// Right now, this function isn't handling the error case at all. What we want
9+
// to do is: If we call the `total_cost` function on a string that is not a
10+
// number, that function will return a `ParseIntError`. In that case, we want to
11+
// immediately return that error from our function and not try to multiply and
12+
// add.
1313
//
1414
// There are at least two ways to implement this that are both correct. But one
1515
// is a lot shorter!

solutions/13_error_handling/errors2.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
// the player typed in the quantity, we get it as a string. They might have
66
// typed anything, not just numbers!
77
//
8-
// Right now, this function isn't handling the error case at all (and isn't
9-
// handling the success case properly either). What we want to do is: If we call
10-
// the `total_cost` function on a string that is not a number, that function
11-
// will return a `ParseIntError`. In that case, we want to immediately return
12-
// that error from our function and not try to multiply and add.
8+
// Right now, this function isn't handling the error case at all. What we want
9+
// to do is: If we call the `total_cost` function on a string that is not a
10+
// number, that function will return a `ParseIntError`. In that case, we want to
11+
// immediately return that error from our function and not try to multiply and
12+
// add.
1313
//
1414
// There are at least two ways to implement this that are both correct. But one
1515
// is a lot shorter!

0 commit comments

Comments
 (0)