diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-11-25 14:38:00 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-11-25 14:39:47 +0100 |
commit | 7792d633c78d4ad39979e09a6215b656f7ec31f2 (patch) | |
tree | eef3ded814e8dcd47b282982c3a44ab9dcd9f4c5 /src/codegen/dyngen.rs | |
parent | c2b5c46ef4ab2de1281c1d8099daa49621e29794 (diff) |
codegen: Minor nits for dynamic function generation.
Diffstat (limited to 'src/codegen/dyngen.rs')
-rw-r--r-- | src/codegen/dyngen.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/codegen/dyngen.rs b/src/codegen/dyngen.rs index aab6cac9..4cd01c01 100644 --- a/src/codegen/dyngen.rs +++ b/src/codegen/dyngen.rs @@ -2,6 +2,7 @@ use crate::ir::function::Abi; use proc_macro2::Ident; /// Used to build the output tokens for dynamic bindings. +#[derive(Default)] pub struct DynamicItems { /// Tracks the tokens that will appears inside the library struct -- e.g.: /// ```ignore @@ -74,18 +75,6 @@ pub struct DynamicItems { init_fields: Vec<proc_macro2::TokenStream>, } -impl Default for DynamicItems { - fn default() -> Self { - DynamicItems { - struct_members: vec![], - struct_implementation: vec![], - runtime_checks: vec![], - constructor_inits: vec![], - init_fields: vec![], - } - } -} - impl DynamicItems { pub fn new() -> Self { Self::default() @@ -141,7 +130,7 @@ impl DynamicItems { } } - pub fn add_function( + pub fn push( &mut self, ident: Ident, abi: Abi, |