Skip to content

Commit

Permalink
tests3: Fix panic message
Browse files Browse the repository at this point in the history
  • Loading branch information
mo8it committed Jul 22, 2024
1 parent 82409c0 commit 5116a81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exercises/17_tests/tests3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl Rectangle {
if width <= 0 || height <= 0 {
// Returning a `Result` would be better here. But we want to learn
// how to test functions that can panic.
panic!("Rectangle width and height can't be negative");
panic!("Rectangle width and height must be positive");
}

Rectangle { width, height }
Expand Down
2 changes: 1 addition & 1 deletion solutions/17_tests/tests3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl Rectangle {
if width <= 0 || height <= 0 {
// Returning a `Result` would be better here. But we want to learn
// how to test functions that can panic.
panic!("Rectangle width and height can't be negative");
panic!("Rectangle width and height must be positive");
}

Rectangle { width, height }
Expand Down

0 comments on commit 5116a81

Please sign in to comment.