mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-30 15:17:25 +00:00
Janitor: Fix type in struct field name
No behavior change is intended here!
This commit is contained in:
parent
a46d936d6f
commit
c33a897bb3
1 changed files with 3 additions and 3 deletions
|
@ -132,13 +132,13 @@ struct AnimalVTable {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
struct Dog{ strenght: i32, is_hungry: bool };
|
||||
struct Dog{ strength: i32, is_hungry: bool };
|
||||
|
||||
// The #[vtable] macro created the Animal Trait
|
||||
impl Animal for Dog {
|
||||
fn make_noise(&self, intensity: i32) -> i32 {
|
||||
println!("Wof!");
|
||||
return self.strenght * intensity;
|
||||
return self.strength * intensity;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ impl AnimalConsts for Dog {
|
|||
AnimalVTable_static!(static DOG_VT for Dog);
|
||||
|
||||
// with that, it is possible to instantiate a vtable::VRefMut
|
||||
let mut dog = Dog { strenght: 100, is_hungry: false };
|
||||
let mut dog = Dog { strength: 100, is_hungry: false };
|
||||
{
|
||||
let mut animal_vref = VRefMut::<AnimalVTable>::new(&mut dog);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue