Skip to content

Commit

Permalink
Fix lint about Err variant being too large
Browse files Browse the repository at this point in the history
  • Loading branch information
jtran committed Oct 19, 2024
1 parent bbee523 commit 1ab397b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wasm-lib/kcl/src/ast/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2719,7 +2719,7 @@ pub struct FunctionExpression {
impl_value_meta!(FunctionExpression);

#[derive(Debug, PartialEq, Clone)]
pub struct RequiredParamAfterOptionalParam(pub Parameter);
pub struct RequiredParamAfterOptionalParam(pub Box<Parameter>);

impl std::fmt::Display for RequiredParamAfterOptionalParam {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down Expand Up @@ -2751,7 +2751,7 @@ impl FunctionExpression {
if param.optional {
found_optional = true;
} else if found_optional {
return Err(RequiredParamAfterOptionalParam(param.clone()));
return Err(RequiredParamAfterOptionalParam(Box::new(param.clone())));

Check warning on line 2754 in src/wasm-lib/kcl/src/ast/types.rs

View check run for this annotation

Codecov / codecov/patch

src/wasm-lib/kcl/src/ast/types.rs#L2754

Added line #L2754 was not covered by tests
}
}
let boundary = self.params.partition_point(|param| !param.optional);
Expand Down

0 comments on commit 1ab397b

Please sign in to comment.