sample-code: Remove "Student" function from match_test
This commit is contained in:
parent
2f94ddd23f
commit
4f40bd4f99
@ -5,10 +5,6 @@ struct Student {
|
|||||||
age: i32,
|
age: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn Student(name: str, age: i32) -> Student {
|
|
||||||
Student { name, age }
|
|
||||||
}
|
|
||||||
|
|
||||||
fn match_test(student: Student) {
|
fn match_test(student: Student) {
|
||||||
match student {
|
match student {
|
||||||
Student { name: "shark", age } => println("Found a shark of ", age, " year(s)"),
|
Student { name: "shark", age } => println("Found a shark of ", age, " year(s)"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user