Skip to content

Commit

Permalink
Fix a borrowing issue introduced by the merge of master
Browse files Browse the repository at this point in the history
The definitions of these were tweaked in some way, I think,
such that references to them are no longer automatically 'static?
  • Loading branch information
kulakowski committed Jul 27, 2023
1 parent 9505a3b commit db28996
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions crates/core/src/sql/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,24 +276,23 @@ fn extract_field(table: &From, of: &SqlExpr) -> Result<Option<ProductTypeElement
/// When `field` is `None`, the type is inferred to an integer or float depending on if a `.` separator is present.
/// The `is_long` parameter decides whether to parse as a 64-bit type or a 32-bit one.
fn infer_number(field: Option<&ProductTypeElement>, value: &str, is_long: bool) -> Result<AlgebraicValue, ErrorVm> {
let ty = match field {
match field {
None => {
if value.contains('.') {
let ty = if value.contains('.') {
if is_long {
&AlgebraicType::F64
AlgebraicType::F64
} else {
&AlgebraicType::F32
AlgebraicType::F32
}
} else if is_long {
&AlgebraicType::I64
AlgebraicType::I64
} else {
&AlgebraicType::I32
}
AlgebraicType::I32
};
parse(value, &ty)
}
Some(f) => &f.algebraic_type,
};

parse(value, ty)
Some(f) => parse(value, &f.algebraic_type),
}
}

/// Compiles a [SqlExpr] expression into a [ColumnOp]
Expand Down

0 comments on commit db28996

Please sign in to comment.