mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-27 00:00:03 +03:00
fix(structs3): Add a hint for panic (#608)
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:
parent
cbcde34540
commit
4f7ff5d9c7
|
@ -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 {
|
||||||
// Something goes here...
|
// panic statement goes here...
|
||||||
} else {
|
} else {
|
||||||
Package {
|
Package {
|
||||||
sender_country,
|
sender_country,
|
||||||
|
|
Loading…
Reference in a new issue