Skip to content

Commit

Permalink
Update src/mapping/query/functions.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Bruce Guenter <[email protected]>
  • Loading branch information
JeanMertz and bruceg authored Sep 9, 2020
1 parent e7d3bb3 commit 1601b2c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/mapping/query/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,10 @@ impl Function for ToBooleanFn {
_ => Err("unable to convert array or object into bool".to_string()),
},
Err(err) => Err(err),
};
if result.is_err() {
if let Some(v) = &self.default {
return Ok(v.clone());
}
}
}.or_else(|err| match &self.default {
Some(v) => Ok(v.clone()),
None => Err(err),
})
result
}
}
Expand Down

0 comments on commit 1601b2c

Please sign in to comment.