Improved safety

This commit is contained in:
2026-06-07 09:49:30 +02:00
parent 9001c1c3e2
commit 27e78dc377
2 changed files with 9 additions and 5 deletions
+5 -1
View File
@@ -8,6 +8,10 @@ pub class Animal {
pub fn speak(*self) {
println!("Unknown");
}
pub fn test_speak(*self) {
self.speak();
}
}
pub class Dog : Animal {
@@ -25,5 +29,5 @@ pub class Dog : Animal {
pub fn run_tests() {
let dawg = Dog::new();
dawg.speak();
dawg.test_speak();
}