We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e9745f commit a6592aaCopy full SHA for a6592aa
1 file changed
lib/segment/src/index/query_optimization/rescore_formula/parsed_formula.rs
@@ -180,8 +180,8 @@ impl ParsedExpression {
180
scale: Option<f32>,
181
kind: DecayKind,
182
) -> OperationResult<PreciseScore> {
183
- let midpoint = midpoint.unwrap_or(DEFAULT_DECAY_MIDPOINT) as PreciseScore;
184
- let scale = scale.unwrap_or(DEFAULT_DECAY_SCALE) as PreciseScore;
+ let midpoint = PreciseScore::from(midpoint.unwrap_or(DEFAULT_DECAY_MIDPOINT));
+ let scale = PreciseScore::from(scale.unwrap_or(DEFAULT_DECAY_SCALE));
185
186
if midpoint <= 0.0 || midpoint >= 1.0 {
187
return Err(OperationError::validation_error(format!(
0 commit comments