-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Box<[Type]> inside of
FunctionType`
#2036
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -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(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rust can infer the target type of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case, |
||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this affect serde somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe it should, but that's a good thing to check -- thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, checked the serde source code: they're both serialized as sequences, so there shouldn't be any effect on the serialization in any format