Skip to content

Commit

Permalink
Update src/expr.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Pete Gadomski <[email protected]>
  • Loading branch information
bitner and gadomski authored Dec 16, 2024
1 parent 8ac73fa commit 93d7940
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,7 @@ impl Expr {
pub fn reduce(&mut self, j: &Value) {
match self {
Expr::Property { property } => {
let mut prefixproperty: String = "properties.".to_string();
prefixproperty.push_str(property);

let mut propexpr: Option<Value> = None;
if j.dot_has(property) {
propexpr = j.dot_get(property).unwrap();
} else {
let mut prefixproperty: String = "properties.".to_string();
prefixproperty.push_str(property);
propexpr = j.dot_get(&prefixproperty).unwrap();
}
let propexpr = j.dot_get(property).or_else(|_| j.dot_get(&format!("properties.{}", property)))?;
if let Some(v) = propexpr {
*self = Expr::from(v);
}
Expand Down

0 comments on commit 93d7940

Please sign in to comment.