Skip to content

Commit

Permalink
fix: eliminate unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Nov 26, 2024
1 parent 6abd289 commit ded8ab5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/erg_compiler/context/inquire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2215,11 +2215,10 @@ impl Context {
}
nth += 1;
}
for not_passed in subr
.default_params
.iter()
.filter(|pt| !passed_params.contains(pt.name().unwrap()))
{
for not_passed in subr.default_params.iter().filter(|pt| {
pt.name()
.map_or(false, |name| !passed_params.contains(name))
}) {
if let ParamTy::KwWithDefault { ty, default, .. } = &not_passed {
if let Err(mut es) = self.sub_unify(default, ty, obj, not_passed.name()) {
errs.append(&mut es);
Expand Down

0 comments on commit ded8ab5

Please sign in to comment.