MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / classify

Function classify

06_pattern_matching/rust/pattern_matching.rs:14–19  ·  view source on GitHub ↗
(animal: Animals)

Source from the content-addressed store, hash-verified

12}
13
14fn classify(animal: Animals) {
15 match animal {
16 Animals::Cat(Cat {age}) => println!("A cat that's {} years old", age),
17 Animals::Dog(d) => println!("A dog named {}", d.name),
18 }
19}
20
21fn number(x: i32) {
22 match x {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected