diff options
Diffstat (limited to 'crates/types')
| -rw-r--r-- | crates/types/src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index 4defb23..b7bf623 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -265,6 +265,16 @@ pub struct FuncType { pub results: Box<[ValType]>, } +impl FuncType { + /// Get the number of parameters of a function type. + pub fn empty() -> Self { + Self { + params: Box::new([]), + results: Box::new([]), + } + } +} + /// A WebAssembly Function #[derive(Debug, Clone)] pub struct Function { |
