fix(structs3): Add panic! statement into structs3

closes #685
This commit is contained in:
camperdue42 2021-12-31 01:05:34 -05:00
parent 9f61db5dbe
commit ace380fd5d

View File

@ -15,7 +15,7 @@ struct Package {
impl Package {
fn new(sender_country: String, recipient_country: String, weight_in_grams: i32) -> Package {
if weight_in_grams <= 0 {
// Something goes here...
panic!("Can not ship a weightless package.")
} else {
return Package {sender_country, recipient_country, weight_in_grams};
}