mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-06-27 00:41:21 +02:00
@ -16,7 +16,7 @@ struct Package {
|
|||||||
impl Package {
|
impl Package {
|
||||||
fn new(sender_country: String, recipient_country: String, weight_in_grams: i32) -> Package {
|
fn new(sender_country: String, recipient_country: String, weight_in_grams: i32) -> Package {
|
||||||
if weight_in_grams <= 0 {
|
if weight_in_grams <= 0 {
|
||||||
// panic statement goes here...
|
panic!("Can not ship a weightless package.")
|
||||||
} else {
|
} else {
|
||||||
Package {
|
Package {
|
||||||
sender_country,
|
sender_country,
|
||||||
|
Reference in New Issue
Block a user