struct Cat;
trait Animal {
const SOUND: &'static str;
fn make_sound(&self) {
println!("{}", Self::SOUND);
}
}
impl Animal for Cat {
const SOUND: &'static str = "Meow!";
}
impl Cat {
const SPEED: u32 = 2;
fn run() {}
}
fn main() {
let cat = Cat;
cat.make_sound();
let _sound = Cat::SOUND;
let _speed = Cat::SPEED;
Cat::run();
}