Update structs3.rs

as a totally newbie to Rust, I don't know panic statement from https://doc.rust-lang.org/book/ and rustlings in the beginning. After a hard searching of [should_panic], then I figure out panic statement. 

So it's helpful to tell the learner that write a panic statement here.
This commit is contained in:
Yang Wen 2020-12-30 11:25:40 +08:00 committed by GitHub
parent a303d508cf
commit 90a3b68334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 statement goes here...
} else {
return Package {
sender_country,