mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-25 23:10:30 +00:00
tests3: Fix panic message
This commit is contained in:
parent
82409c060f
commit
5116a812fb
2 changed files with 2 additions and 2 deletions
|
@ -9,7 +9,7 @@ impl Rectangle {
|
||||||
if width <= 0 || height <= 0 {
|
if width <= 0 || height <= 0 {
|
||||||
// Returning a `Result` would be better here. But we want to learn
|
// Returning a `Result` would be better here. But we want to learn
|
||||||
// how to test functions that can panic.
|
// 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 }
|
Rectangle { width, height }
|
||||||
|
|
|
@ -9,7 +9,7 @@ impl Rectangle {
|
||||||
if width <= 0 || height <= 0 {
|
if width <= 0 || height <= 0 {
|
||||||
// Returning a `Result` would be better here. But we want to learn
|
// Returning a `Result` would be better here. But we want to learn
|
||||||
// how to test functions that can panic.
|
// 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 }
|
Rectangle { width, height }
|
||||||
|
|
Loading…
Reference in a new issue