[lang2/macro] make codegen more precise when using traits

parent d73f6c3d
...@@ -175,7 +175,7 @@ impl Storage<'_> { ...@@ -175,7 +175,7 @@ impl Storage<'_> {
impl ink_core::storage::Flush for Storage { impl ink_core::storage::Flush for Storage {
fn flush(&mut self) { fn flush(&mut self) {
#( #(
self.#field_idents.flush(); ink_core::storage::Flush::flush(&mut self.#field_idents);
)* )*
} }
} }
...@@ -264,11 +264,13 @@ impl Storage<'_> { ...@@ -264,11 +264,13 @@ impl Storage<'_> {
impl ink_core::storage::Flush for StorageAndEnv { impl ink_core::storage::Flush for StorageAndEnv {
fn flush(&mut self) { fn flush(&mut self) {
self.__storage.flush(); ink_core::storage::Flush::flush(&mut self.__storage);
self.__env.flush(); ink_core::storage::Flush::flush(&mut self.__env);
} }
} }
impl ink_core::storage::alloc::Initialize for StorageAndEnv { impl ink_core::storage::alloc::Initialize for StorageAndEnv {
type Args = (); type Args = ();
...@@ -277,8 +279,8 @@ impl Storage<'_> { ...@@ -277,8 +279,8 @@ impl Storage<'_> {
} }
fn initialize(&mut self, _args: Self::Args) { fn initialize(&mut self, _args: Self::Args) {
self.__storage.try_default_initialize(); ink_core::storage::alloc::Initialize::try_default_initialize(&mut self.__storage);
self.__env.try_default_initialize(); ink_core::storage::alloc::Initialize::try_default_initialize(&mut self.__env);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment