Skip to content

Commit

Permalink
Merge pull request #2036 from wasmerio/fix/waste-less-memory-with-fun…
Browse files Browse the repository at this point in the history
…ction-type

Use Box<[Type]>` inside of `FunctionType`
  • Loading branch information
syrusakbary authored Jan 22, 2021
2 parents 4d5481b + b597a6b commit a1043b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/wasmer-types/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ impl ExternType {
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub struct FunctionType {
/// The parameters of the function
params: Vec<Type>,
params: Box<[Type]>,
/// The return values of the function
results: Vec<Type>,
results: Box<[Type]>,
}

impl FunctionType {
Expand All @@ -242,8 +242,8 @@ impl FunctionType {
Returns: Into<Vec<Type>>,
{
Self {
params: params.into(),
results: returns.into(),
params: params.into().into_boxed_slice(),
results: returns.into().into_boxed_slice(),
}
}

Expand Down

0 comments on commit a1043b7

Please sign in to comment.