Skip to content

Commit

Permalink
feat(types) Avoid allocating a Vec when calling FunctionType::new.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Feb 25, 2021
1 parent da12f69 commit a5347fe
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 @@ -238,12 +238,12 @@ impl FunctionType {
/// Creates a new Function Type with the given parameter and return types.
pub fn new<Params, Returns>(params: Params, returns: Returns) -> Self
where
Params: Into<Vec<Type>>,
Returns: Into<Vec<Type>>,
Params: Into<Box<[Type]>>,
Returns: Into<Box<[Type]>>,
{
Self {
params: params.into().into_boxed_slice(),
results: returns.into().into_boxed_slice(),
params: params.into(),
results: returns.into(),
}
}

Expand Down

0 comments on commit a5347fe

Please sign in to comment.