Skip to content

Commit

Permalink
fix(structs3): Add a hint for panic (#608)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sundevilyang authored Feb 4, 2022
1 parent cbcde34 commit 4f7ff5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exercises/structs/structs3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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 {
Package {
sender_country,
Expand Down

0 comments on commit 4f7ff5d

Please sign in to comment.